Left Side View of a Tree
Given a binary tree root
, return the leftmost node’s value on each level of the tree.
Constraints
n ≤ 100,000
wheren
is the number of nodes inroot
https://binarysearch.com/problems/Left-Side-View-of-a-Tree
Examples
Example 1
Input
- root =
Output
- answer =
[0, 5, 1]
Leave a comment