Merge pull request #716 from chanhz/master

Update Leetcode 题解 - 动态规划.md
This commit is contained in:
CyC2018 2019-06-04 21:41:38 +08:00 committed by GitHub
commit 6a401bc0af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -299,7 +299,7 @@ dp[4] = dp[3] + 1 = 3
综上,在 A[i] - A[i-1] == A[i-1] - A[i-2] 时dp[i] = dp[i-1] + 1。
因为递增子区间不一定以最一个元素为结尾,可以是任意一个元素结尾,因此需要返回 dp 数组累加的结果。
因为递增子区间不一定以最一个元素为结尾,可以是任意一个元素结尾,因此需要返回 dp 数组累加的结果。
```java
public int numberOfArithmeticSlices(int[] A) {