Given an integer array nums and integer , find the maximum sum of a non-empty subsequence where consecutive elements in the subsequence have indices at most apart.
Example: nums = [10, 2, -10, 5, 20], k = 2. One valid subsequence: indices 0, 1, 3, 4 with values [10, 2, 5, 20]. The gap between consecutive indices is at most 2. Sum = 37. This looks similar to Jump Game VI, but there's a twist. You don't have to include every position you "visit." You're choosing a subsequence, not a path.