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
Is your feature request related to a problem? Please describe.
Given the root of a binary tree, return the lowest common ancestor of its deepest leaves.
Describe the solution you'd like
Using the pair<> container of STL library in c++, I will keep the track of the node with their respective levels and the node with the deepest level will be the answer.
Describe alternatives you've considered
It can also be done using hashmap but using pair the code becomes more clear and concise.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Given the root of a binary tree, return the lowest common ancestor of its deepest leaves.
Describe the solution you'd like
Using the pair<> container of STL library in c++, I will keep the track of the node with their respective levels and the node with the deepest level will be the answer.
Describe alternatives you've considered
It can also be done using hashmap but using pair the code becomes more clear and concise.
The text was updated successfully, but these errors were encountered: