This problem is same as Longest Substring Without Repeating Characters (Leetcode Problem No 3)
```\n int maximumUniqueSubarray(vector& nums) {\n        int i=0;\n        int j=0;\n        int sum=0;\n        int ans = INT_MIN;\n        map mp;\n        wh
```\n int maximumUniqueSubarray(vector<int>& nums) {\n        int i=0;\n        int j=0;\n        int sum=0;\n        int ans = INT_MIN;\n        map<int,int> mp;\n        while(j<nums.size())\n        {\n            mp[nums[j]]++;\n            sum+=nums[j];\n            \n            if(mp.size()==j-i+1)\n            {\n                ans=max(ans,sum);\n                j++;\n            }\n            \n            else if(mp.size()<j-i+1)\n            {\n                while(mp.size()<j-i+1)\n                {\n                    sum-=nums[i];\n                    mp[nums[i]]--;\n                    if(mp[nums[i]]==0)\n                        mp.erase(nums[i]);\n                    i++;\n                }\n                j++;\n            }\n            \n        }\n        \n        return ans;\n    }
['C', 'Sliding Window']