LeetCode Solutions/Problems/1936. Add Minimum Number of Rungs.java
<gh_stars>0class Solution {
    public int addRungs(int[] rungs, int dist) {
        int previous = 0, minimumNumberOfRungs = 0;
        for(int r:rungs){
            minimumNumberOfRungs += (r-previous-1) / dist;
            previous = r;
        }
        return minimumNumberOfRungs;
    }
}