public int maxLength (int[] arr) { HashMap<Integer,Integer> map = new HashMap<>(); int max = 1; for(int start = 0, end = 0; end<arr.length ; end++){ if(map.containsKey(arr[end])){ //重复了 start = Math.max(start, map.get(arr[end])+1); ...