If current element is greater than range , put it on next available greater position .
elif arr [ i ] > highVal : NEW_LINE INDENT temp = arr [ i ] NEW_LINE arr [ i ] = arr [ end ] NEW_LINE arr [ end ] = temp NEW_LINE end -= 1 NEW_LINE DEDENT else : NEW_LINE INDENT i += 1 NEW_LINE DEDENT