Traverse the array in reverse
for i in range ( N - 1 , - 1 , - 1 ) : NEW_LINE INDENT if ( i == N - 1 ) : NEW_LINE INDENT suffix [ i ] [ 0 ] = arr [ i ] NEW_LINE suffix [ i ] [ 1 ] = arr [ i ] NEW_LINE DEDENT else : NEW_LINE DEDENT