If the elementIndex has an element that is not processed yet , then first store that element to arr [ i ] so that we don 't lose anything.
if arr [ elementIndex ] > 0 : NEW_LINE INDENT arr [ i ] = arr [ elementIndex ] NEW_LINE DEDENT