Simple java solution
```\nclass Solution {\n    public int maximumUniqueSubarray(int[] n) {\n        int i=0,j=0,s=0,p=0,k=n.length;\n        Set nm=new HashSet<>();\n        while(
```\nclass Solution {\n    public int maximumUniqueSubarray(int[] n) {\n        int i=0,j=0,s=0,p=0,k=n.length;\n        Set<Integer> nm=new HashSet<>();\n        while(i<k&&j<k)\n        {\n            if(!nm.contains(n[j]))\n            {\n                s+=n[j];\n                p=Math.max(p,s);\n                nm.add(n[j++]);\n            }\n            else\n            {\n                s-=n[i];\n                nm.remove(n[i++]);\n            }\n        }\n        return p;\n    }\n}
['Sliding Window', 'Java']