Corruption in Freedonia
Corruption is on the rise in the country of Freedonia, Gru's home. This corruption network can be represented in the form of a tree having $N$ nodes and $N-1$ edges. The nodes are numbered from $1$ to $N$, and the tree is rooted at node $1$. These nodes represent the corrupt officials and each corrupt official works under some other corrupt official (except the Boss, who is represented by node
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