Given the root of a binary tree and a target node value, find and return the values of all ancestors of the target node, ordered from the parent up to the root (or root down to parent).
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.