You need to compute $A \setminus B$ and $B \setminus A$. 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 $A$ that are not in set $B$, and vice versa.
This is a straightforward application of set difference. The operation is not symmetric, so you must compute both directions.