3
int addRungs(vector<int> &rungs, int dist) {4
// to keep the track of the number of extra rung to be added5
long long int count = 0;7
// our curr pos at the beggining8
long long int currpos = 0;10
// to keep the track of the next pos to be climed11
long long int nextposidx = 0;14
if (currpos == rungs[rungs.size() - 1]) {18
if ((rungs[nextposidx] - currpos) <= dist) {19
currpos = rungs[nextposidx];22
// cout<<"hello"<<endl;23
long long int temp = (rungs[nextposidx] - currpos);24
// cout<<"temp = "<<temp<<endl;26
if ((temp % dist) == 0) {27
long long int val = temp / dist;28
count = count + (val - 1);30
long long int val = floor(((temp * 1.00) / (dist * 1.00)));31
count = count + (val);33
currpos = rungs[nextposidx];