Original and simple Python solution using Dict and recursion


#1
class Solution:
    # @param A : root node of tree
    # @return a list of list of integers
    def levelOrder(self, A):
        nodes = {}
        self.discover(A, 0, nodes)
        return [v for k, v in nodes.items()]
    
    def discover(self, A, level, nodes):
        if not A:
            return
        
        if level not in nodes:
            nodes[level] = []
        
        nodes[level].append(A.val)
        self.discover(A.left, level + 1, nodes)
        self.discover(A.right, level + 1, nodes)