Driver code
public static void main ( String [ ] args ) { Stack < Integer > s = new Stack < Integer > ( ) ; s . add ( 10 ) ; s . add ( 20 ) ; s . add ( 30 ) ; s . add ( 40 ) ; s . add ( 50 ) ; int arr [ ] = { 20 , 30 } ; int n = arr . length ; if ( checkArrInStack ( s , arr , n ) ) System . out . print ( "YESNEW_LINE"); else System . out . print ( "NONEW_LINE"); } }