If stack becomes empty , then price [ i ] is greater than all elements on left of it , i . e . price [ 0 ] , price [ 1 ] , . . price [ i - 1 ] . Else the price [ i ] is greater than elements after top of stack
S [ i ] = i + 1 if len ( st ) <= 0 else ( i - st [ - 1 ] ) NEW_LINE