prints element and NSE pair for all elements of arr [ ] of size n
public static void printNSE ( int arr [ ] , int n ) { Stack < Integer > s = new Stack < Integer > ( ) ; HashMap < Integer , Integer > mp = new HashMap < Integer , Integer > ( ) ;