update: 最大子序和
This commit is contained in:
parent
e9fd76de1b
commit
c5f7255d3a
@ -232,8 +232,8 @@ LeetCode 与 LintCode 解题记录。此为个人练习仓库,代码中对重
|
|||||||
- [最大子序和](src/array/maximum-subarray.js)
|
- [最大子序和](src/array/maximum-subarray.js)
|
||||||
|
|
||||||
- LeetCode 53. 最大子序和 https://leetcode-cn.com/problems/maximum-subarray/
|
- LeetCode 53. 最大子序和 https://leetcode-cn.com/problems/maximum-subarray/
|
||||||
|
- LeetCode 面试题42. 连续子数组的最大和 https://leetcode-cn.com/problems/lian-xu-zi-shu-zu-de-zui-da-he-lcof/
|
||||||
- LintCode 41. 最大子数组 https://www.lintcode.com/problem/maximum-subarray/description
|
- LintCode 41. 最大子数组 https://www.lintcode.com/problem/maximum-subarray/description
|
||||||
- LintCode 620. 最大子序列的和IV https://www.lintcode.com/problem/maximum-subarray-iv/description
|
|
||||||
|
|
||||||
## 栈
|
## 栈
|
||||||
|
|
||||||
|
@ -2,5 +2,4 @@ import { maxSubArray } from '../../src/array/maximum-subarray'
|
|||||||
|
|
||||||
test('最大子序和', () => {
|
test('最大子序和', () => {
|
||||||
expect(maxSubArray([-2, 1, -3, 4, -1, 2, 1, -5, 4])).toBe(6)
|
expect(maxSubArray([-2, 1, -3, 4, -1, 2, 1, -5, 4])).toBe(6)
|
||||||
// expect(maxSubArray([-2, 2, -3, 4, -1, 2, 1, -5, 3])).toBe(5)
|
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user