C++ Maps + Sum Based Two Pointers
\nclass Solution {\npublic:\n    int maximumUniqueSubarray(vector<int>& nums) {\n        // ekk map banaloooo\n        \n        //  hum ekk map bana lengeeeee 
```\nclass Solution {\npublic:\n    int maximumUniqueSubarray(vector<int>& nums) {\n        // ekk map banaloooo\n        \n        //  hum ekk map bana lengeeeee uske baad max lenge so jo sabse longest side ka map hogaaa wo le lengeeeeeeeee............\n        map<int,int>harsh;\n        int maxi=INT_MIN;\n        int i=0,j=0;\n        int sum=0;\n        while(i<nums.size())\n        {\n           while(j<i && harsh[nums[i]] !=0 )\n           {\n              // ye hum shuru se substring ka size dekh rahe haiiiiii agar humko repetated element dikh raha haiii tohhh hum map se erase kardenge in short uske size ko 0 kardengeeeee\n             harsh[nums[j]]=0;\n               sum-=nums[j++];\n           }\n            // normal agar wo repeated nhi haiii bss usme add kardete haiiii substring ke side ko badhate jaooooo matlab sum add karlooooo\n            if(harsh[nums[i]]==0)\n            {\n               harsh[nums[i]]=1;\n                sum+=nums[i++];\n            }\n            maxi=max(maxi,sum);\n        }\n        return maxi;\n        }\n};\n```
['C']