Skip to content
LC-3222 Easy LeetCode

3222. Find the Winning Player in Coin Game

Read the full problem statement on LeetCode.
Difficulty: easy Acceptance: 52% Topics: Math, Simulation, Game Theory
View full problem on LeetCode
Reference solution (spoiler · python)
# Time:  O(1)
# Space: O(1)

# math
class Solution(object):
    def losingPlayer(self, x, y):
        """
        :type x: int
        :type y: int
        :rtype: str
        """
        return "Alice" if min(x, y//4)%2 else "Bob"

Solution from kamyu104/LeetCode-Solutions · MIT