HashMap to get the indices of array A
map = { } NEW_LINE for i in range ( N ) : NEW_LINE INDENT map [ A [ i ] ] = i NEW_LINE DEDENT for i in range ( N ) : NEW_LINE INDENT if ( A [ i ] != B [ i ] ) : NEW_LINE DEDENT