Problem
You get two arrays of the same length, nums1 and nums2, and a number k. Choose `k` indices. The score of your choice is
Example 1
(sum of nums1 at the chosen indices) * (minimum of nums2 at the chosen indices)
Return the maximum possible score.
Example 2
- Input
- nums1 = [1, 3, 3, 2], nums2 = [2, 1, 3, 4], k = 3
- Output
- 12
Choosing indices 0, 2 and 3 gives (1 + 3 + 2) * min(2, 3, 4) = 6 * 2 = 12.
Constraints
1 <= k <= n <= 10^5 (n is the length of both arrays)0 <= nums1[i], nums2[i] <= 10^5