Check if substring [ 0 , i ] is appended at end how many changes will be required
for ( int i = 0 ; i < n ; i ++ ) { if ( n % 2 != 0 ) { minimum = min ( minimum , oddone [ n ] - oddone [ i + 1 ] + evenone [ i + 1 ] ) ; minimum = min ( minimum , evenone [ n ] - evenone [ i + 1 ] + oddone [ i + 1 ] ) ; } }