Chef and Cities
CodeChefOpen on judge ↗
There are $N$ Cities connected to each other through a network. Each city is represented by an integer $1,2,3,...N$. An $Entry-City$ is defined as a City which is connected to only one other city in the network. The Network is a [tree](https://en.wikipedia.org/wiki/Tree_(data_structure)#:~:text=In%20computer%20science%2C%20a%20tree,a%20set%20of%20linked%20nodes.). Each city has a locked door at i
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