1103. Distribute Candies to People
Содержание
class Solution:
def distributeCandies(self, candies: int, num_people: int) -> List[int]:
res = [0] * num_people
i = 0
while candies:
res[i % num_people] += min(candies, i + 1)
candies -= min(candies, i + 1)
i += 1
return res