driver program to test the above function
public static void main ( String args [ ] ) { int a [ ] = { 2 , 1 , 3 , 4 , 5 } ; int n = a . length ; int k = 2 ; System . out . println ( winner ( a , n , k ) ) ; } }