← ALL NOTES
Array

2099. Find Subsequence of Length K With the Largest Sum

Given nums and k, return a length-k subsequence with the maximum sum, keeping the elements in their original array order (any answer is fine on ties). Take the k largest values, but emit them in…

Loading…