Skip to content

Commit a4efba7

Browse files
committed
Create 1431.拥有最多糖果的孩子.js
1 parent 7f009b3 commit a4efba7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

1431.拥有最多糖果的孩子.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @param {number[]} candies
3+
* @param {number} extraCandies
4+
* @return {boolean[]}
5+
*/
6+
var kidsWithCandies = function(candies, extraCandies) {
7+
const max = Math.max(...candies);
8+
return candies.map(n => n + extraCandies >= max);
9+
};

0 commit comments

Comments
 (0)