Given the root of a binary tree and two nodes p and q that exist in the tree, return their lowest common ancestor: the deepest node that has both p and q as descendants (a node may be a descendant of…
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.