text: Find the player to be able to replace the last element that can be replaced by its divisors | C # program for the above approach ; Function to find the winner of the game played based on given conditions ; A wins if size of array is odd ; Otherwise , B wins ; Driver Code ; Input array ; Size of the array
code: using System ; public class GFG { static void winner ( int [ ] arr , int N ) { if ( N % 2 == 1 ) { Console . Write ( " A " ) ; } else { Console . Write ( " B " ) ; } } public static void Main ( String [ ] args ) { int [ ] arr = { 24 , 45 , 45 , 24 } ; int N = arr . Length ; winner ( arr , N ) ; } }