算法原型 /** 1. 求数组中等于给定值的最长子数组 */ public class LongestSubArrayEqualsAim { public static int solve(int[] arr, int target) { if (arr == null || arr.length == 0) return 0; //key:sum value:pos HashMap<Integer, Integer> map = new HashMap<>(); map.put(0, -1); int res = 0; int sum = 0; for (int i ...