← All problemsSign in

Birthday Game

Problem Statement A game is played on an array whose ith value is denoted by arr[i]. The game is defined as follows: One move is defined as removing any two numbers from the array, 'a' and 'b', and adding to the end of array a new number c such that c = a + b + (a * b). This is continued alternately between the players until only one number remains, res. The result of the game is res + 1. We c

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