Traversing and storing minimum of a [ j ] + | i - j | upto i from the end
for ( i = n - 2 ; i >= 0 ; i -- ) dp2 [ i ] = Math . Min ( arr [ i ] , dp2 [ i + 1 ] + 1 ) ; List < int > v = new List < int > ( ) ;