You are given an integer array nums and a positive integer k.
Return the sum of the minimum and maximum values of all non empty subsequences of nums with a size of at most k. Since the answer may be very large, return it modulo
Note: A subsequence is a sequence that can be derived from an array by deleting zero or more elements without changing the order of the remaining elements.
Constraints:
nums.length
nums[i]
k nums.length
You are given an integer array nums and a positive integer k.
Return the sum of the minimum and maximum values of all non empty subsequences of nums with a size of at most k. Since the answer may be very large, return it modulo
Note: A subsequence is a sequence that can be derived from an array by deleting zero or more elements without changing the order of the remaining elements.
Constraints:
nums.length
nums[i]
k nums.length