javascript O(n)
\n/**\n * @param {number[]} nums\n * @return {number}\n */\nvar maximumUniqueSubarray = function(nums) {\n    const n = nums.length;\n    \n    const store = ne
```\n/**\n * @param {number[]} nums\n * @return {number}\n */\nvar maximumUniqueSubarray = function(nums) {\n    const n = nums.length;\n    \n    const store = new Set();\n    \n    let max = 0,\n        left = 0,\n        sum = 0;\n    \n    for(let i = 0; i < n; i++) {\n        while(store.has(nums[i])) {\n            store.delete(nums[left]);\n            sum -= nums[left];\n            left += 1;\n        }\n        sum += nums[i];\n        store.add(nums[i]);\n        max = Math.max(max, sum);\n    }\n    return max;\n};\n```
['Sliding Window', 'JavaScript']