BEST SOLUTION -- 2 POINTERS -- EASIEST TO UNDERSTAND -- BEATS 98%
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n    Keep SLIDING  the "
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n    Keep <b>SLIDING </> the "end" pointer in each iteration. slide the start pointer only when duplicate is found! \n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution(object):\n    def maximumUniqueSubarray(self, nums):\n        """\n        :type nums: List[int]\n        :rtype: int\n        """\n        start=0\n        end=0\n        maxl=0\n        cur=0\n        dic={}\n        while end<len(nums):\n            if nums[end] not in dic:\n                dic[nums[end]]=-1\n            if dic[nums[end]]==-1:\n                dic[nums[end]]=end  #store index position!\n                cur+=nums[end]\n            elif dic[nums[end]]!=-1 :\n                 #repetition found\n                 if(cur>maxl):\n                     maxl=cur\n                 ist=start\n                 start=dic[nums[end]]+1\n                 for i in range(ist,dic[nums[end]]+1):\n\n                     cur-=nums[i]\n                     \n                     dic[nums[i]]=-1\n                 dic[nums[end]]=end\n                 cur+=nums[end]\n            end+=1\n        if cur>maxl:\n            maxl=cur\n        return maxl\n```
['Python']