Problem 2542 · Medium

Maximum Subsequence Score

Sweep pairs by nums2 from largest to smallest, keeping the best k nums1 values in a min-heap.

Open the interactive visualisation