← All problemsSign in

3836. Maximum Score Using Exactly K Pairs

LeetCodeArrayDynamic ProgrammingOpen on judge ↗

You are given two integer arrays nums1 and nums2 of lengths n and m respectively, and an integer k. You must choose exactly k pairs of indices (i1, j1), (i2, j2), ..., (ik, jk) such that: - 0 <= i1 < i2 < ... < ik < n - 0 <= j1 < j2 < ... < jk < m For each chosen pair (i, j), you gain a score of nums1[i] * nums2[j]. The total score is the sum of the products of all selected pairs. Return an

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start