Given a tree, populate a friends list on every node, where a node's friends are itself and all other nodes on the same level (depth) of the tree. Return the tree with friends filled in.
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.