You need to compute and . For each, iterate through the first set and check if elements are absent from the second.
Convert both arrays to sets to remove duplicates. Then filter elements in set that are not in set , and vice versa.
This is a straightforward application of set difference. The operation is not symmetric, so you must compute both directions.