Medium
Traverse a tree level by level.
Return the level order traversal of a binary tree as a list of value lists from top to bottom.
Examples
Input: root = [3,9,20,null,null,15,7]
Output: [[3],[9,20],[15,7]]
Constraints
- Tree may be empty
Coding Challenge
Traverse a tree level by level.
Return the level order traversal of a binary tree as a list of value lists from top to bottom.
Input: root = [3,9,20,null,null,15,7]
Output: [[3],[9,20],[15,7]]
Preparing your coding workspace...