Sliding Window || Set || Clean Code || JAVA
Time Complexity (Worst) :  O(N x K) where K is the range from the starting till we find that duplicate.\n\n\nclass Solution {\n    public int maximumUniqueSubar
Time Complexity (Worst) :  O(N x K) where K is the range from the starting till we find that duplicate.\n\n```\nclass Solution {\n    public int maximumUniqueSubarray(int[] nums) {\n        \n        int start = 0, end = 0, sum = 0, max = 0;\n        HashSet<Integer> set = new HashSet<>();\n        \n        while(end < nums.length){\n            \n            if(set.add(nums[end])){\n\t\t\t// if we don\'t have any duplicate item in our set\n                sum += nums[end];\n                end++;\n            }\n            else{\n\t\t\t//remove and substract elements from starting until the duplicate element got removed.\n                sum -= nums[start];\n                set.remove(nums[start]);\n                start++;\n            }\n\t\t\t//keeping track of the maximum sum of the subarray we got till now\n            max = Math.max(sum, max);\n        }\n        \n        return max;\n    }\n}\n```
['Sliding Window', 'Java']