Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 414 Bytes

File metadata and controls

14 lines (10 loc) · 414 Bytes

Problem 6: Layered Perspective

Problem Statement

Given the root of a binary tree, return the level order traversal of its nodes' values. (i.e., from left to right, level by level).

Input Format

  • The root of a binary tree.

Output Format

  • A list of lists, where each inner list represents a level.

Example

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