Java/JavaScript/Python Beginner friendly Solutions
Java\n\nclass Solution {\n    public int maximumUniqueSubarray(int[] nums) {\n        Set<Integer> set = new HashSet<>();\n        int i = 0, j = 0, sum = 0, ma
**Java**\n```\nclass Solution {\n    public int maximumUniqueSubarray(int[] nums) {\n        Set<Integer> set = new HashSet<>();\n        int i = 0, j = 0, sum = 0, max = 0;\n        while(i < nums.length && j < nums.length){\n            if(!set.contains(nums[j])){\n                set.add(nums[j]);\n                sum += nums[j++];\n                max = Math.max(sum, max);\n            } else{\n                set.remove(nums[i]);\n                sum -= nums[i++];\n            }\n        }\n        return max;\n    }\n}\n```\n**JavaScript**\n```\nvar maximumUniqueSubarray = function(nums) {\n    let set = new Set()\n    let i = 0, j = 0, sum = 0, max = 0\n    while(i < nums.length && j < nums.length){\n        if(!set.has(nums[j])){\n            set.add(nums[j])\n            sum += nums[j++]\n            max = Math.max(sum, max)\n        } else{\n            set.delete(nums[i])\n            sum -= nums[i++]\n        }\n    }\n    return max\n};\n```\n**Python**\n```\nclass Solution(object):\n    def maximumUniqueSubarray(self, nums):\n        s = set()\n        i, j, summ, maxx = 0, 0, 0, 0\n        while i < len(nums) and j < len(nums) :\n            if not nums[j] in s:\n                s.add(nums[j])\n                summ += nums[j]\n                maxx = max(summ, maxx)\n                j += 1\n            else :\n                s.remove(nums[i])\n                summ -= nums[i]\n                i += 1\n        return maxx\n```
['Python', 'Java', 'JavaScript']