1528. Kids With the Greatest Number of Candies
My accepted Python solution to LeetCode problem 1528, Kids With the Greatest Number of Candies, running in 0ms.
- Difficulty: Easy
- Python
- Runtime 0ms
- Memory 12.6MB
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
Python
Accepted on LeetCode — runtime 0ms, memory 12.6MB, accepted 2025-12-24.
class Solution(object):
def kidsWithCandies(self, candies, extraCandies):
max_candies = max(candies)
return [c + extraCandies >= max_candies for c in candies]