import java.util.*; public class Solution { /** * * @param arr int整型一维数组 the array * @return int整型 */ public int maxLength (int[] arr) { int maxLen = 0; HashMap<Integer, Integer> hash = new HashMap<>(); int i = 0, j = 0; for(; j < arr.length; ++j) { if(hash.containsKey(arr[j])) { int ...