C++ Sliding Window 99% Faster No Library Hash Map O(1) Lookup time
\nclass Solution {\npublic:\n    \n    int maximumUniqueSubarray(vector<int>& nums) {\n        int res = 0;\n        int currSum = 0;\n        \n        int m[1
```\nclass Solution {\npublic:\n    \n    int maximumUniqueSubarray(vector<int>& nums) {\n        int res = 0;\n        int currSum = 0;\n        \n        int m[100001] = {};\n        //Value is the index in this map\n        int i = 0;\n        int j = 0;\n        \n        while( j < nums.size()){\n            \n            if( m[nums[j]]){ //We have to contract\n                while( m[nums[j]]){\n                    currSum -= nums[i]; ///Pops it off the tail\n                    m[nums[i]]--;\n                    ++i;\n                }\n            }\n            //House keeping comparisons\n            m[nums[j]]++;\n            currSum += nums[j];\n            res = max (res, currSum);\n            ++j;\n        }\n        \n        \n        return res;\n        \n        \n    }\n};\n\n\n```
['C', 'Sliding Window']