You are given an integer array nums.
You may delete any number of elements from nums. After performing the deletions, select a contiguous subarray from the remaining array such that all elements in the selected subarray are unique.
Return the maximum possible sum of such a subarray.
Constraints:
nums.length
nums[i]
You are given an integer array nums.
You may delete any number of elements from nums. After performing the deletions, select a contiguous subarray from the remaining array such that all elements in the selected subarray are unique.
Return the maximum possible sum of such a subarray.
Constraints:
nums.length
nums[i]