':type root: TreeNode
:rtype: List[List[int]]'

def findLeaves(self, root):

    def findLeavesHelper(node, result):
        if (not node):
            return (-1)
        level = (1 + max(findLeavesHelper(node.left, result), findLeavesHelper(node.right, result)))
        if (len(result) < (level + 1)):
            result.append([])
        result[level].append(node.val)
        return level
    result = []
    findLeavesHelper(root, result)
    return result
