Using 2 bits X & Y, initially (0,0)
You have to print a given string of 0 &1 in minimum instructions
Instructions available are:
A: toggles the bit X.
B: toggles the bit Y.
C: prints the value of bit X followed by bit Y.
D: prints the value of bit X.
E: prints the value of bit Y.
The first line contains number of test cases T (<=500)
Each of the following T lines contains a string consisting of 0s and 1s only.
Length of string<=200.
For each test case, print minimum number of instructions required to print the given string