1936. Add Minimum Number of Rungs

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

Содержание

LeetCode problem 1936

class Solution:
    def addRungs(self, rungs: List[int], dist: int) -> int:
        rungs = [0] + rungs
        return sum((b - a - 1) // dist for a, b in pairwise(rungs))