Winner Prediction
CodeChefOpen on judge ↗
John and Manoj are travelling in a train and they are bored of journey. So they decide to play a game, the rules for which are described below. Given array A containing n integers, they take turns making a single move. John moves first always, and both players are moving optimally (playing to win with no mistakes). During each move, the current player chooses one element from A, adds it to their
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