3625. Stone Removal Game
My accepted Python solution to LeetCode problem 3625, Stone Removal Game, running in 0ms.
- Difficulty: Easy
- Python
- Runtime 0ms
- Memory 17.2MB
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
Python
Accepted on LeetCode — runtime 0ms, memory 17.2MB, accepted 2026-01-01.
class Solution:
def canAliceWin(self, n: int) -> bool:
# Alice removes 10, Bob removes 9, Alice removes 8, etc.
stones_to_remove = 10
alice_turn = True
while n >= stones_to_remove and stones_to_remove > 0:
n -= stones_to_remove
stones_to_remove -= 1
alice_turn = not alice_turn
# If it's Bob's turn and he can't move, Alice wins
return not alice_turn