Driver code
public static void main ( String [ ] args ) { int N = 7 ; ArrayList < Integer > nums = new ArrayList < Integer > ( Arrays . asList ( 3 , 4 , 7 , 1 , 2 , 5 , 6 ) ) ; int count = make_xor_half ( nums ) ; if ( count == - 1 ) System . out . print ( - 1 + "NEW_LINE"); else if ( count == 1 ) System . out . print ( nums . get ( N ) + "NEW_LINE"); else System . out . print ( nums . get ( N ) + " ▁ " + nums . get ( N + 1 ) + "NEW_LINE"); } }