Create a function that takes in two arrays and returns an intersection array and a union array.
While the input arrays may have duplicate numbers, the returned intersection and union arrays should be set-ified - that is, contain no duplicates. Returned arrays should be sorted in ascending order.
Array 1: [5, 6, 6, 6, 8, 9]
Array 2: [3, 3, 4, 4, 5, 5, 8]
Intersection: [5, 8]
// 5 and 8 are the only 2 numbers that exist in both arrays.
Union: [3, 4, 5, 6, 8, 9]
// Each number exists in at least one array.
intersectionUnion([1, 2, 3, 4, 4], [4, 5, 9]) ➞ [[4], [1, 2, 3, 4, 5, 9]]
intersectionUnion([1, 2, 3], [4, 5, 6]) ➞ [[], [1, 2, 3, 4, 5, 6]]
intersectionUnion([1, 1], [1, 1, 1, 1]) ➞ [[1], [1]]
[Intersection], [Union].[] for the intersection.