If stack becomes empty , then no element is greater on left side . Else top of stack is previous greater .
s . empty ( ) ? cout << " - 1 , ▁ " : cout << s . top ( ) << " , ▁ " ; s . push ( arr [ i ] ) ; } }