Foo and Chocolates
CodeChefOpen on judge ↗
Foo's father brought Foo a lot of Chocolates from Switzerland, where every chocolate has a number printed on its wrapper, but he has devised a game to give Foo a limited number of chocolates. All the chocolates are in a bag. Foo's Father will give Foo one chocolate at a time and will stop giving him another if the chocolate he takes out of the bag has the number 0 on its wrapper. You need to deter
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