You and your friend are playing a simple Nim Game:
• There is a single heap of stones on the table.
• You and your friend take turns, with you going first.
• On each turn, a player can remove 1 to 3 stones from the heap.
• The player who removes the last stone wins the game.
Given an integer n, representing the number of stones, return true if you can guarantee a win assuming both players play optimally, otherwise return false.
Input: n = 4
Output: false
Input: n = 1
Output: true
Accepted:
Submission: