2136. Earliest Possible Day of Full Bloom

Обновлено: 2024-03-12
1 мин
[]

Содержание

LeetCode problem 2136

class Solution:
    def earliestFullBloom(self, plantTime: List[int], growTime: List[int]) -> int:
        res = t = 0
        for pt, gt in sorted(zip(plantTime, growTime), key=lambda x: -x[1]):
            t += pt
            res = max(res, t + gt)
        return res