https://leetcode.com/problems/arithmetic-slices/public class Solution { public int numberOfArithmeticSlices(int[] A) { if (A.length < 3) { return 0; } int lastLen = 1; int lastDiff = A[1] - A[0]; int ret = 0; for (int i=2; i
本文共 334 字,大约阅读时间需要 1 分钟。
https://leetcode.com/problems/arithmetic-slices/public class Solution { public int numberOfArithmeticSlices(int[] A) { if (A.length < 3) { return 0; } int lastLen = 1; int lastDiff = A[1] - A[0]; int ret = 0; for (int i=2; i
转载于:https://www.cnblogs.com/charlesblc/p/5966646.html