Local results are inconsistent with the server running


  • 0
    H
    class Solution:
    parm = [[]]
    
    def order(self, node, level):
        if node is None:
            return
        else:
            if level == len(self.parm):
              self.parm.append([])
            self.parm[level].append(node.val)
            self.order(node.left, level+1)
            self.order(node.right, level+1)
    
    # @param root, a tree node
    # @return a list of lists of integers
    def levelOrderBottom(self, root):
        if root is None:
            return []
        self.order(root, 0)
        self.parm.reverse()
        return self.parm
    

    input:{1, 2}
    local: [[2], [1]]
    server: [[2], [1, 1]]


Log in to reply
 

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