Given an integer array nums, you may choose exactly one contiguous subarray whose elements are all distinct. The value of a chosen subarray is the sum of its elements. Return the maximum possible value among all such subarrays.
Constraints:
nums.length
nums[i]
Given an integer array nums, you may choose exactly one contiguous subarray whose elements are all distinct. The value of a chosen subarray is the sum of its elements. Return the maximum possible value among all such subarrays.
Constraints:
nums.length
nums[i]