Problem 3410 · Hard

Maximize Subarray Sum After Removing All Occurrences of One Element

Optionally delete every copy of one value, then find the largest subarray sum of what remains.

Open the interactive visualisation