this hard version problem the difference version hard version ask additionally minimum number subsegmentstokitsukaze binary string s length n consist zero one n evenNow Tokitsukaze divide s minimum number contiguous subsegment subsegment bit subsegment after s consider good length subsegment evenfor example s 11001111 divide 11 00 1111 their length 2 2 4 respectively number 11001111 good another example s 1110011000 divide 111 00 11 000 length 3 2 2 3 obviously 1110011000 goodtokitsukaze want s good change value position s specifically perform operation number time change value s_i 0 1 1 leq leq n can tell minimum number operation s good meanwhile wants know minimum number subsegment s divide solution minimum number operation