← All problemsSign in

Color Festival

CodeChefRating 588Open on judge ↗

It is the festival of colors, and you decide to visit your $N$ friends one by one. When you visit friend $i$, your face is painted with color $C_i$. - Initially, your face has **no color**. - If the color currently on your face is different from the color applied by the next friend, your face color **changes**. In particular, when your face has no color and a color is applied to it, your face

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