Tap here to switch tabs
Problem
Submissions

Problem: Maximum Score Using Exactly K Pairs

med
30 min
Try to solve the Maximum Score Using Exactly K Pairs problem.

Statement

You are given two integer arrays nums1 and nums2, and an integer k.

You must choose kk indices i1<i2<⋯<iki_1 < i_2 < \dots < i_k from nums1 and kk indices j1<j2<⋯<jkj_1 < j_2 < \dots < j_k from nums2.

The score of this selection is:

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Score Using Exactly K Pairs

med
30 min
Try to solve the Maximum Score Using Exactly K Pairs problem.

Statement

You are given two integer arrays nums1 and nums2, and an integer k.

You must choose kk indices i1<i2<⋯<iki_1 < i_2 < \dots < i_k from nums1 and kk indices j1<j2<⋯<jkj_1 < j_2 < \dots < j_k from nums2.

The score of this selection is: