CHEF AND THE CANDY BAR
CodeChefOpen on judge ↗
Chef has opened a candy bar. He has N packets of candies which need to be exported to different people. Each packet has different number of candies in it. Chef has to put these packets in an array of consecutive white and black boxes such that each box contains a single packet and every black box have candies greater than the candies in the adjacent white boxes. Also the array starts with white bo
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