Given a generic tree represented by an adjacency list and node values, count all special nodes. A node is defined as special if all the elements along the path from the root to that node are distinct.
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.