From 15e41e476e4aab0bc0d70fbc8364e004702c7ed0 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Sun, 7 Jan 2024 16:05:10 +0100 Subject: [PATCH] =?UTF-8?q?cs:=20add=20=E2=80=9C1431.=20Kids=20With=20the?= =?UTF-8?q?=20Greatest=20Number=20of=20Candies=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Matej Focko --- cs/kids-with-the-greatest-number-of-candies.cs | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 cs/kids-with-the-greatest-number-of-candies.cs diff --git a/cs/kids-with-the-greatest-number-of-candies.cs b/cs/kids-with-the-greatest-number-of-candies.cs new file mode 100644 index 0000000..ce8878b --- /dev/null +++ b/cs/kids-with-the-greatest-number-of-candies.cs @@ -0,0 +1,6 @@ +public class Solution { + public IList KidsWithCandies(int[] candies, int extraCandies) { + var max = candies.Max(); + return candies.Select(candies => candies + extraCandies >= max).ToList(); + } +}