LeetCode solutions

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

Read the problem on LeetCode View on GitHub

Python

Accepted on LeetCode — runtime 0ms, memory 12.6MB, accepted 2025-12-24.

python
class Solution(object):
    def kidsWithCandies(self, candies, extraCandies):
        max_candies = max(candies)
        return [c + extraCandies >= max_candies for c in candies]

Source