Chef and Balls
CodeChefOpen on judge ↗
Surprisingly, the Chef found today’s Codeathon problems slightly difficult, so he came up with an easy one. Chef has come across a bag of balls containing different coloured balls. The bag has n balls of the following colors: Black($B$), White($W$), Red($R$), Green($G$) and Pink($P$). Chef decides to empty the bag and aligns all the balls in a row next to each other and begins to play with them o
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