Union and Intersection of Two Sorted Arrays

Given two integer arrays a and b sorted in ascending order, return a two-element array [union, intersection]. The union array must contain every distinct value present in either input, and the intersection array must contain every distinct value present in both inputs. Both result arrays must be sorted in ascending order. Repeated input values must appear only once in each result.

Examples
Input: [[],[]]
Output: [[],[]]
Hints

Union and Intersection of Two Sorted Arrays

Given two integer arrays `a` and `b` sorted in ascending order, return a two-element array `[union, intersection]`. The `union` array must contain every distinct value present in either input, and the `intersection` array must contain every distinct value present in both inputs. Both result arrays must be sorted in ascending order. Repeated input values must appear only once in each result.