Tap here to switch tabs
Problem
Submissions

Problem: Maximum Unique Subarray Sum After Deletion

Maximum Unique Subarray Sum After Deletion lets you remove elements from an array, then choose a contiguous remaining subarray with unique values. Return the maximum sum. Values may be negative.

Statement

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:

  • 1≤1 \leq nums.length ≤100\leq 100

  • −100≤-100 \leq nums[i] ≤100\leq 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Unique Subarray Sum After Deletion

Maximum Unique Subarray Sum After Deletion lets you remove elements from an array, then choose a contiguous remaining subarray with unique values. Return the maximum sum. Values may be negative.

Statement

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:

  • 1≤1 \leq nums.length ≤100\leq 100

  • −100≤-100 \leq nums[i] ≤100\leq 100