public class Solution {
public IList KidsWithCandies(int[] candies, int extraCandies) {
var maxCandy = candies.Max();
return candies.Select(candy => candy + extraCandies >= maxCandy).ToList();
}
}
Source:
https://leetcode.com/problems/kids-with-the-greatest-number-of-candies/
"Simplicity can't be bought later, it must be earned from the start" -- DB
Sunday, February 14, 2021
Leetcode Everyday: 1431. Kids With Greatest Number of Candies. Easy
Labels:
leetcode
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment