Find the player to be able to replace the last element that can be replaced by its divisors | Function to find the winner of the game played based on given conditions ; A wins if size of array is odd ; Otherwise , B wins ; Input array ; Size of the array
function winner ( arr , N ) { if ( N % 2 === 1 ) { document . write ( " " ) ; } else { document . write ( " " ) ; } } var arr = [ 24 , 45 , 45 , 24 ] ; var N = arr . length ; winner ( arr , N ) ;