← All problemsSign in

Rainy Game

It's a rainy day and Vignesh and Aravind are stuck inside watching the rain. They decide to invent a game, the rules for which are described below. Given array A containing n integers, they take turns making a single move. Both players are moving optimally (playing to win and making no mistakes). During each move, the current player chooses one element from A, adds it to their own score, and del

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