Tap here to switch tabs
Problem
Submissions

Problem: Maximum Score Using Exactly K Pairs

Maximum Score Using Exactly K Pairs asks you to choose exactly k increasing indices from each integer array and maximize the sum of products formed by pairing the selected values.

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

Maximum Score Using Exactly K Pairs asks you to choose exactly k increasing indices from each integer array and maximize the sum of products formed by pairing the selected values.

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: