1936. Add Minimum Number of Rungs
On This Page
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))
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))