#3360
Stone Removal Game
pupil · 485 · lc easy +27 · 42.4% accepted · 68 likes · top 23%
Description
Alice and Bob play a game taking turns removing stones from a pile, with Alice going first.
- On her first turn, Alice must remove exactly 10 stones.
- Each subsequent player removes exactly 1 fewer stone than their opponent just did.
A player who cannot remove any stones loses.
Given a positive integer n, return true if Alice wins and false otherwise.
Code
1
2
3