Given a binary tree and two nodes a and b, find their lowest common ancestor (LCA). Then, as a variation, given a target node and an integer k, return all nodes at distance k from the target, where…
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.