You are given two integer arrays nums1 and nums2, both of equal length.
Your task is to rearrange (shuffle) the elements of nums1 so that it wins against nums2 as many times as possible.
A "win" is counted when at index i, nums1[i] > nums2[i].
Return any version of nums1 that achieves the highest number of such winning positions.
Input: nums1 = [4, 9, 1, 7] nums2 = [3, 8, 5, 6]
Output: [7, 9, 1, 4]
Explanation:
7 > 6, 9 > 8 (2 wins)
Input: nums1 = [5, 10, 15, 20] nums2 = [12, 6, 25, 3]
Output: [6, 10, 15, 20]
Explanation:
10 > 6, 20 > 3 (2 wins)
Accepted:
Submission: