From 06bb242e1ea4f399bd4697005bb2ca70fb3054e8 Mon Sep 17 00:00:00 2001 From: Gabriel Donnan <47415809+gabedonnan@users.noreply.github.com> Date: Thu, 12 Jan 2023 12:04:21 +0000 Subject: [PATCH] Create greatest-candies.py simple oneliner solution, probably not technically most efficient implementation but it is the most elegant --- greatest-candies.py | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 greatest-candies.py diff --git a/greatest-candies.py b/greatest-candies.py new file mode 100644 index 0000000..e6a57bd --- /dev/null +++ b/greatest-candies.py @@ -0,0 +1,3 @@ +class Solution: + def kidsWithCandies(self, candies: List[int], extraCandies: int) -> List[bool]: + return [candy + extraCandies >= max(candies) for candy in candies]