How to Compute the Intersection of Two Arrays using Sorting + Two Pointer Algorithm?

Given two arrays, write a function to compute their intersection. Example 1: Input: nums1 = , nums2 = Output: Example 2: Input: nums1 = , nums2 = Output: Note: …