Find the player who wins the game by removing the last of given N cards | Java program to implement the above approach ; Function to check which player can win the game ; Driver code
import java . util . * ; class GFG { static void checkWinner ( int N , int K ) { if ( N % ( K + 1 ) > 0 ) { System . out . print ( " A " ) ; } else { System . out . print ( " B " ) ; } } public static void main ( String [ ] args ) { int N = 50 ; int K = 10 ; checkWinner ( N , K ) ; } }