Alternating Binary String

Make a binary string alternating — no two adjacent characters the same — by flipping individual characters. Each flip changes a 0 to 1 or a 1 to 0. Find the minimum number of flips required. An alternating binary string follows the pattern "010101..." or "101010...".

Examples
Input: "0100"
Output: 1
Hints

Alternating Binary String

Make a binary string alternating — no two adjacent characters the same — by flipping individual characters. Each flip changes a `0` to `1` or a `1` to `0`. Find the minimum number of flips required. An alternating binary string follows the pattern `"010101..."` or `"101010..."`.