Medium

Quiz

#107 Binary Tree Level Order Traversal II

APPROACH

Given the root of a binary tree, return a bottom-up collection of node values: starting from the deepest level and working up to the root, listing each level's values left to right.

Example 1:

Input: root = [3,9,20,null,null,15,7]
Output: [[15,7],[9,20],[3]]

Example 2:

Input: root = [1]
Output: [[1]]

Example 3:

Input: root = []
Output: []
1 of 4
1:00

What is the optimal approach for this problem?