LeetCode: Kids With the Greatest Number of Candies
Determine which kids can have the greatest number of candies after receiving extra candies.
See original problem on leetcode.com
Difficulty: Easy
Solution
Runtime
0 ms | Beats 100.00%
class Solution: def kidsWithCandies(self, candies: List[int], extraCandies: int) -> List[bool]: answer = [] most = max(*candies)
for i in range(len(candies)): if candies[i] + extraCandies >= most: answer.append(True) else: answer.append(False)
return answer