bits of even length made of 0 and 1. Call a string tidy if it can be cut into pieces so that every piece has even length and consists of a single repeated symbol (all zeros or all ones).
One fix flips any single character. Return the minimum number of fixes that makes bits tidy.bits="0110" → 2
Both pairs "01" and "10" are mixed, so each needs one change, giving e.g. "0000". Total 2.
bits="110000" → 0
The string already splits into "11" and "0000", so nothing needs changing.
bits="01" → 1
bits contains only 0 and 1bits="0110"
2
Run checks the first 3 tests in your browser. Submit checks all 119 tests on the server, hidden ones included.