Update length of both subarrays to the maximum
ans = Math . max ( ans , v . get ( i ) . get ( 0 ) + v . get ( i + 1 ) . get ( 0 ) ) ; } if ( v . get ( i + 1 ) . get ( 1 ) - v . get ( i ) . get ( 2 ) - 1 == 1 ) {