arr [ i ] wants to extend largest subsequence
elif ( arr [ i ] > arr [ tailIndices [ leN - 1 ] ] ) : NEW_LINE INDENT prevIndices [ i ] = tailIndices [ leN - 1 ] NEW_LINE tailIndices [ leN ] = i NEW_LINE leN += 1 NEW_LINE DEDENT