Design an algorithm to compute the union of two input sets given as arrays, both of size O(n).
The output should be an array of distinct elements that form the union of the sets. No element should appear more than once. The worst-case running time of your algorithm should be
O(n log n)