Update the value of steps [ i ]
steps [ i ] = Math . min ( steps [ i ] , R - i ) ; } } static int accumulate ( int [ ] arr , int start , int end ) { int sum = 0 ; for ( int i = 0 ; i < arr . length ; i ++ ) sum += arr [ i ] ; return sum ; }