Gift of a Friend
CodeChefOpen on judge ↗
Sufiyan is an engineering student. He loves data structures a lot, especially binary tree. Once he gifted his friend Irshad a rooted directed binary tree. As Irshad doesn't know much about trees, he wonders how to find the root of the tree. Irshad needs your help. You will be given a binary tree consisting of n nodes. All the nodes are numbered from 0 to n-1. Your task is to print the number on t
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start