1431. Kids With the Greatest Number of Candies
class Solution:
def kidsWithCandies(self, candies: List[int], extraCandies: int) -> List[bool]:
result = [False] * len(candies)
max_candy = max(candies)
for i in range(len(candies)):
if candies[i] + extraCandies >= max_candy:
result[i] = True
return result
O(N)
(N: candies의 길이)O(N)