滑动窗口模板
int l = 1, r = 1, sum = 0;
ArrayList<int[]> list = new ArrayList<>();
while (r < window.length) {
if (sum < target) {
sum += window[r];
r++;
} else if (sum > target) {
sum -= window[l];
l++;
} else {
int[] copyOfRange = Arrays.copyOfRange(window, l, r);
list.add(copyOfRange);
sum -= window[l];
l++;
}
}