Race to N
Players alternately add 1, 2 or 3 to a running total starting at 0; whoever says exactly N wins. Who wins with perfect play?
Input: one integer N.
Output: FIRST or SECOND.
Constraints:
- 1 ≤ N ≤ 1018
Sample Tests
Input 1
4
Output 1
SECOND
Input 2
7
Output 2
FIRST
Discussion (opens after you solve — no spoilers before)
No comments yet.