Return the intersection of two arrays, taking multiplicity into account.
Example 1
Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4]
Output: [4,9]
Explanation: 9 appears once in the first array, so the result contains only one 9 and one 4.
Output: [4,9]
Explanation: 9 appears once in the first array, so the result contains only one 9 and one 4.
Example 2
Input: nums1 = [1,2,2,1], nums2 = [2,2]
Output: [2,2]
Explanation: Taking multiplicity into account, 2 appears in the result twice.
Output: [2,2]
Explanation: Taking multiplicity into account, 2 appears in the result twice.