Sunday, February 14, 2021

Leetcode Everyday: 1431. Kids With Greatest Number of Candies. Easy

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/

No comments:

Post a Comment