C++ Solution (Variable Sliding Window)
Solution-->\n\nclass Solution {\npublic:\n    int maximumUniqueSubarray(vector<int>& nums) {\n//         Tried acquire ->store and release\n        unordered_ma
Solution-->\n```\nclass Solution {\npublic:\n    int maximumUniqueSubarray(vector<int>& nums) {\n//         Tried acquire ->store and release\n        unordered_map<int,int> map;\n        int i=0;\n        int j=0;\n        int ans=0;\n        int sum=0;\n        int count=0;\n        while(j<nums.size()){\n//             Release\n            map[nums[j]]++;\n             count++;\n            while(count>map.size()){\n                map[nums[i]]--;\n                sum=sum-nums[i];\n                if(map[nums[i]]==0){\n                    map.erase(nums[i]);\n                }\n                i++;\n                count--;\n            }\n\t\t\t//Acquire\n            sum=sum+nums[j];\n            j++;\n            ans=max(ans,sum);\n           \n        }\n        return ans;\n    }\n};\n```
['C', 'Sliding Window']