Kids With the Greatest Number of Candies

LeetCode題目: 1431. Kids With the Greatest Number of Candies

My solution:

/**
 * @param {number[]} candies
 * @param {number} extraCandies
 * @return {boolean[]}
 */
let kidsWithCandies = (candies, extraCandies) => candies.map(v => (v + extraCandies) >= Math.max(...candies) ? true : false );
profile-image
Hi, 我是 Zeki。目前為一名前端工程師。我相信科技始終來自於人性,是用來幫助人們過上更有品質的生活的,但願也希望如此。