TIME & SPACE 99% BEATS || C++ || SLIDING WINDOW
\nclass Solution {\npublic:\n    int maximumUniqueSubarray(vector<int>& nums) {\n        vector<int> v(1e4+2);\n        int i = 0, j = 0, n = nums.size(),sum = 
```\nclass Solution {\npublic:\n    int maximumUniqueSubarray(vector<int>& nums) {\n        vector<int> v(1e4+2);\n        int i = 0, j = 0, n = nums.size(),sum = 0,ans = 0;\n        while(i<n){\n            sum += nums[i];\n            v[nums[i]]++;\n            while(v[nums[i]]==2){\n                sum -= nums[j];\n                v[nums[j]]--;\n                j++;\n            }\n            i++;\n            ans = max(ans,sum);\n        }\n        return ans;\n    }\n};\n```
['Two Pointers', 'C', 'Sliding Window', 'C++']