add: 拥有最多糖果的孩子

This commit is contained in:
2020-06-01 05:14:21 +08:00
parent 46dc5e9b3d
commit 4aa8eba735
3 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,7 @@
import { kidsWithCandies } from '../../src/array/kids-with-the-greatest-number-of-candies'
test('拥有最多糖果的孩子', () => {
expect(kidsWithCandies([2, 3, 5, 1, 3], 3)).toEqual([true, true, true, false, true])
expect(kidsWithCandies([4, 2, 1, 1, 2], 1)).toEqual([true, false, false, false, false])
expect(kidsWithCandies([12, 1, 12], 10)).toEqual([true, false, true])
})