← All problemsSign in

CHEF AND HIS FENCE

Chef has been toiling in the sun, painting his fence. After he finishes up, to his shock, he finds out that he has painted his fence with the wrong colors and he cannot go out to buy more paint. Luckily, he can dye his old paint into any color he wants, but there are two conditions: - Chef cannot dye individual pickets. Instead, he will have to dye all pickets of a particular color together. -

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