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