SIMPL Off-Campus Hiring | Maximum Erasure Value | OA (2023)
Question · Posted Jun 2026
Problem Statement Given an integer array nums, find the maximum possible sum of a subarray containing only unique elements. A subarray is a contiguous part of the array. If a duplicate element appears, the subarray is no longer valid. Return the maximum sum among all valid subarrays. Example Input: nums = [4,2,4,5,6] Output: 17 Explanation: The subarray [2,4,5,6] contains all unique elements. Sum = 2 + 4 + 5 + 6 = 17 So, the maximum erasure value is 17. ...
The full answer & interview discussion are available to premium members.
Log in Create a free account