Given two sorted arrays nums1 and nums2, return their intersection as a sorted array. Each element in the result must be unique. Use binary search for lookup. Return an empty array if no intersection exists.
Input: Two sorted integer arrays nums1 and nums2.
Output: Sorted array of unique common elements.
Input: [1,2,3,4,5], [3,4,5,6,7]
Output: [3,4,5]
Explanation: Common elements: 3,4,5.Input: [1,2,3], [4,5,6]
Output: []
Explanation: No common elements.Input: [1,2,2,3], [2,2,4]
Output: [2]
Explanation: 2 is common; result is unique.0 <= nums1.length, nums2.length <= 10^3-10^3 <= nums[i] <= 10^3Both sorted ascending