You are given two positive integers x and y, denoting the number of coins with values 75 and 10 respectively.
Alice and Bob are playing a game. Each turn, starting with Alice, the player must pick up coins with a total value 115. If the player is unable to do so, they lose the game.
Return the name of the player who wins the game if both players play optimally.
Examples
Example 1
Input: x = 2, y = 7
Output: "Alice"
Explanation:
The game ends in a single turn:
Example 2
Input: x = 4, y = 11
Output: "Bob"
Explanation:
The game ends in 2 turns:
Constraints
1 <= x, y <= 100
3222. Find the Winning Player in Coin Game
Easy
10 Points
Math
Simulation
Game Theory
You are given two positive integers x and y, denoting the number of coins with values 75 and 10 respectively.
Alice and Bob are playing a game. Each turn, starting with Alice, the player must pick up coins with a total value 115. If the player is unable to do so, they lose the game.
Return the name of the player who wins the game if both players play optimally.
Examples
Example 1
Input: x = 2, y = 7
Output: "Alice"
Explanation:
The game ends in a single turn:
Example 2
Input: x = 4, y = 11
Output: "Bob"
Explanation:
The game ends in 2 turns:
Constraints
1 <= x, y <= 100
Find the Winning Player in Coin Game - Practice Coding | SlaveCode