Go - Sliding window - O(n) with hashmap
\nfunc maximumUniqueSubarray(nums []int) int {\n    if len(nums) == 0 {return 0}\n    if len(nums) == 1 {return nums[0]}\n    \n    res := -1 << 63\n    \n    m
```\nfunc maximumUniqueSubarray(nums []int) int {\n    if len(nums) == 0 {return 0}\n    if len(nums) == 1 {return nums[0]}\n    \n    res := -1 << 63\n    \n    m := make(map[int]int)\n    m[nums[0]]++\n    l, sum := 0, nums[0]\n    \n    for i := 1; i < len(nums); i++ {\n        sum+= nums[i]\n        m[nums[i]]++\n        \n        for m[nums[i]] > 1 {\n            m[nums[l]]--\n            sum -= nums[l]\n            \n            if m[nums[l]] == 0 {\n                delete(m, nums[l])\n            }\n            \n            l++\n        }\n        \n        if sum > res {\n            res = sum\n        }\n    }\n    \n    return res\n}\n```
['Go']