Description
Solutions
Submission
Secure Password

A password string, pwd, consists of binary characters (0s and 1s). A cyber security expert is trying to determine the minimum number of changes required to make the password secure. To do so, it must be divided into substrings of non-overlapping, even length substrings. Each substring can only contain 1s or 0s, not a mix. This helps to ensure that the password is string and less vulnerable to hacking attacks.

Find the minimum number of characters that must be flipped in the password string, i.e. changed from 0 to 1 or 1 to 0 to allow the string to be divided as described.

Note: A substring is a contiguous sequence of characters in a string.

Example 1:

Input:  pwd = "1110011000"
Output: 3
Explanation:
The two substrings have lengths 8 and 2 respectively. Since both lengths are even, the division is valid. So the answer is 3.
Constraints:
    N/A (if you know about it, feel free to let us know. TY!
Testcase

Result
Case 1

input:

output: