[Admin please read, potentially a bug] NULL input case problem


  • 0
    B

    My code kept failing on the null case, so I deleted all my code and try to figure what OJ expect on the null case, here is my experiments:

    1. Just return None:
    class Solution(object):
        def copyRandomList(self, head):
            """
            :type head: RandomListNode
            :rtype: RandomListNode
            """
            return None
    

    Result:

    Input: None
    Output: {}
    Expected: {-1,#}
    
    1. Return the expected node:
    class Solution(object):
        def copyRandomList(self, head):
            """
            :type head: RandomListNode
            :rtype: RandomListNode
            """
            return RandomListNode(-1)
    

    Result:

    Input: None
    Output: {-1,#}
    Expected: {}
    

    Not sure if it is a bug or I'm understanding the outputs wrong, could admin explain what's going on here?


  • 0
    B

    Just ran into a few more failures, look like the input is not showing right. It should be the same as the value of expected


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.