We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
This game is composed of the repeating group of LWWWWWL
Therefore the solution in Java is like this -->
System.out.println(scanner.nextInt()%7<2?"Second":"First");
Game of Stones
You are viewing a single comment's thread. Return to all comments →
This game is composed of the repeating group of
LWWWWWL
Therefore the solution in Java is like this --> System.out.println(scanner.nextInt()%7<2?"Second":"First");Source: https://www.cs.umd.edu/~gasarch/COURSES/250/S15/nimnotes.pdf