Skip to content

Commit 2a184df

Browse files
authored
Create find-the-winning-player-in-coin-game.py
1 parent 7b06f37 commit 2a184df

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Time: O(1)
2+
# Space: O(1)
3+
4+
# math
5+
class Solution(object):
6+
def losingPlayer(self, x, y):
7+
"""
8+
:type x: int
9+
:type y: int
10+
:rtype: str
11+
"""
12+
return "Alice" if min(x, y//4)%2 else "Bob"

0 commit comments

Comments
 (0)