← All problemsSign in

GEM GAME

Players A and B are playing a game. The game is simple. There are gems placed in front of them and each player can pick up either 3, 4 or 7 of the gems in front of them during each turn. A is always the first one to play. the players lose if they are unable make a valid move during their turn and also if they are left with no gems to pick up. Your challenge is, given the number of gems placed in

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