One or All
Chef and Chefina are playing a game. There are $N$ piles where $i^{th}$ pile contains $A_i$ stones. The players take alternate turns with **Chef starting the game**. In his/her turn, a player can make **one** of the following type of move: - Type $1$: Choose **any** non-empty pile and remove $1$ stone from that pile. - Type $2$: Remove $1$ stone each from **all** the $N$ piles. This move can be
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