add: 最大子序和

This commit is contained in:
2020-05-03 19:11:29 +08:00
parent 801073e385
commit e9fd76de1b
3 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,6 @@
import { maxSubArray } from '../../src/array/maximum-subarray'
test('最大子序和', () => {
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)
})