#3222
Find the Winning Player in Coin Game
pupil · 435 · lc easy +25 · 53.1% accepted · 128 likes · top 44%
Description
You are given positive integers x (coins worth 75) and y (coins worth 10). Alice and Bob alternate, with Alice first. Each turn the player picks coins totaling exactly 115. A player unable to do so loses.
Return the name of the winner assuming both play optimally.
Code
1
2
3