first and second. Return a list of two lists:
- the first holds every distinct number of first that does not appear in second;
- the second holds every distinct number of second that does not appear in first.
Each number appears at most once in the answer. The order of numbers inside each list does not matter.first=[4, 8, 15, 8], second=[15, 16, 23] → [[8, 4], [16, 23]]
Only the first array has 4 and 8 (the 8 counts once), only the second has 16 and 23. The 15 is in both.
first=[-2, 0], second=[0, -2, -2] → [[], []]
Both arrays hold the same set of values, so both lists are empty.
first=[4, 8, 15, 8], second=[15, 16, 23]
[[8, 4], [16, 23]]
Run checks the first 3 tests in your browser. Submit checks all 113 tests on the server, hidden ones included.