可能是比较容易理解的一种解法 import java.util.*; public class Solution { /** * * @param arr int整型一维数组 the array * @return int整型 */ public int maxLength (int[] arr) { int[] dict = new int[100000]; int maxLen = 0; //用于记录重复元素出现的位置的值 int lastRepeatIndex =...