标签:solution tco col distrib elf def range div and
1 class Solution: 2 def distributeCandies(self, candies: int, num_people: int) -> ‘List[int]‘: 3 res = [0] * num_people 4 t = 0 5 while candies >= 0: 6 for i in range(num_people): 7 t += 1 8 if candies >= t: 9 res[i] += t 10 candies -= t 11 else: 12 res[i] += candies 13 return res 14 return res 15 16
标签:solution tco col distrib elf def range div and
原文地址:https://www.cnblogs.com/asenyang/p/11109421.html