Christmas Tree Decoration
CodeChefOpen on judge ↗
Christmas is coming and Rahul has decided to decorate the Christmas tree for which he has asked his N - 1 friends to help. Rahul has purchased bulbs of M different colours, which are numbered from 1 to M. Each friend has already decided the colour of the bulb he would like to hang on the tree. But then, they face a problem: Currently, none of the bulbs are connected. So they have to be connect
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