class Solution(object): def levelOrderBottom(self, root): """ :type root: TreeNode :rtype: List[List[int]] """ if not root: return  ans =  now = [root] while now: ans.insert(0, [i.val for i in now]) now = [j for i in now for j in (i.left, i.right) if j] return ans
will anyone be able to explain what happens during the while loops?
how do you change the level of the tree (if [3, 9, 20, null, null, 15,7]) from first level  to second level [9,20]?
it seen like after the nest for loop the level auto change to the next level?
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.