← All problemsSign in

Teaching Tree

There are n student coders enrolled in a college, numbered from 1 to n. They are all eager to learn. Each student is so smart that not only can he/she learn the stuff taught by others but also teach the same to anyone else who wants to learn. In this way each student in the college eventually learns the topic. The first student to study the topic is Iam Root (whose number is 1). He then teaches it

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start