Pop the element till we can 't  get the larger value then  the current value
if len ( s ) != 0 : NEW_LINE INDENT right_index [ i ] = s [ - 1 ] NEW_LINE DEDENT else : NEW_LINE INDENT right_index [ i ] = 0 NEW_LINE DEDENT