If the element at top of stack is less than the current element then pop the stack top and keep updating the value of h3
while ( st . Count != 0 && st . Peek ( ) < arr [ i ] ) { h3 = st . Peek ( ) ; st . Pop ( ) ; }