AmazonOA #337
Reverse Binary String with Minimum Shifts
估计中等可在线判题
Each time, remove one character from any position of the binary string and append it to the end. The target is the reverse of the original string. Find the minimum number of operations.
输入格式
One line containing a binary string. The original bounds are 1≤length≤100000.
输出格式
Output a single integer, the answer.
样例 1
输入:
00110101
输出:
3
样例 2
输入:
01
输出:
1
样例 3
输入:
0110
输出:
0
样例说明
The outputs of the three public examples are 3; 1; and 0, checked by independent enumeration or direct simulation.