add: 三数之和

This commit is contained in:
2020-06-12 13:12:29 +08:00
parent ada2de5c1a
commit fb6131a64e
3 changed files with 44 additions and 0 deletions

8
test/math/3sum.test.js Normal file
View File

@ -0,0 +1,8 @@
import { threeSum } from '../../src/math/3sum.js'
test('三数之和', () => {
expect(threeSum([-1, 0, 1, 2, -1, -4])).toEqual([
[-1, -1, 2],
[-1, 0, 1]
])
})