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 );