We’re preparing your current view and syncing the latest data.
You are playing the Nim game with your friend. There is a heap of stones on the table, and you take turns removing 1 to 3 stones. The player who takes the last stone wins. Given the number of stones, determine if you can win the game assuming both players play optimally.
An integer n representing the number of stones.
Return true if you can win the game, otherwise false.
1 <= n <= 2^31 - 1
Example 1
Input
4
Output
false
Explanation
Cannot win if stones are multiple of 4.
Example 2
Input
1
Output
true
Explanation
Can win if stones are not a multiple of 4.