Skip to content

Commit

Permalink
1431. Kids With the Greatest Number of Candies Leet Code #97
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmedKhalil777 committed Apr 17, 2023
1 parent af2db21 commit 82b7a48
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LeetCode.Algorithms;

public class Kids_With_the_Greatest_Number_of_Candies
{
public IList<bool> KidsWithCandies(int[] candies, int extraCandies)
{
var maxAdjusted = candies.Max() - extraCandies;
return candies.Select(_ => _ >= maxAdjusted).ToList();
}
}

0 comments on commit 82b7a48

Please sign in to comment.