Find the player who will win by choosing a number in range [ 1 , K ] with sum total N | Function to predict the winner ; Given Input ; Function call
function predictTheWinner ( K , N ) { if ( N % ( K + 1 ) == 0 ) document . write ( " " ) ; else document . write ( " " ) ; } var K = 7 , N = 50 ; predictTheWinner ( K , N ) ;