Ctrl K

A Toll of 115

Easy
There are big coins worth 75 and small coins worth 10 on the table. Alice and Bob take turns, Alice first. On each turn a player must take coins worth exactly 115 in total. A player who cannot do so loses. Return the winner's name: "Alice" or "Bob" (both play optimally).
Example 1
big=3, small=9 → 'Bob'

Every turn takes one 75 coin and four 10 coins. Alice pays, Bob pays, and then only one 75 and one 10 are left: Alice cannot pay, so Bob wins.

Example 2
big=5, small=4 → 'Alice'

The 10 coins are enough for exactly one payment; Alice makes it and Bob loses.

Example 3
big=1, small=3 → 'Bob'
Constraints
  • 0 ≤ big ≤ 100
  • 0 ≤ small ≤ 100
Have you seen this problem in a real interview?
Solved by0
Tried by0
Submissions0
Acceptance—
Topics
Similar problemsSum of Binary Strings EasyFold the Digits Down to One EasyStone Pile: Who Moves First EasyCounting Off by Threes and Fives EasyAdding Long Numbers in Strings Easy
loading Python…
Input
big=3, small=9
Expected
'Bob'

Run checks the first 3 tests in your browser. Submit checks all 107 tests on the server, hidden ones included.