Game of Nim with removal of one stone allowed | JAVA Code For Game of Nim with removal of one stone allowed ; Return true if player A wins , return false if player B wins . ; Checking the last bit of N . ; Driver program to test above function
import java . util . * ; class GFG { static int findWinner ( int N ) { return N & 1 ; } public static void main ( String [ ] args ) { int N = 15 ; if ( findWinner ( N ) == 1 ) System . out . println ( " Player ▁ A " ) ; else System . out . println ( " Player ▁ B " ) ; } }