← All problemsSign in

Ketu and Petu

Chef saw Ketu and Petu playing the following game. - There are $n$ cards placed in a line on a table with each card having a value on it. Card $i$ has value $C_i$, where $1 \leq i \leq n$. Initially, $C_1$ is at the front and $C_n$ is at the back. - Both of them take their turn alternately with Petu starting the game. - Petu draws card from the front of the remaining cards. - Ketu draws card from

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