Java program to print the Leftover element after performing alternate Bitwise OR and Bitwise XOR operations to the pairs .
import java . util . * ; class GFG { static int N = 1000 ; static int lastElement ( int a [ ] , int n ) {