You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hint 1
Use BFS, traverse the tree level by level and always push the left node first
Hint 2
When you reach the target node, mark a boolean variable true
Hint 3
If you meet another node in the same level after marking the boolean true, return this node.
Hint 4
If you did not meet new nodes in the same level and started traversing a new level, return Null