Traversing and storing minimum of a [ j ] + | i - j | upto i from the end
for i in range ( n - 2 , - 1 , - 1 ) : NEW_LINE INDENT dp2 [ i ] = min ( arr [ i ] , dp2 [ i + 1 ] + 1 ) NEW_LINE DEDENT v = [ ] NEW_LINE