← 返回 amazon 的题目列表Minimize Adjacent Differences in Server Type String
类型:online_judge
amazon
Given a string serverType of length n consisting of '0', '1', and '?', where '0' means the server has high fault tolerance, '1' means the server has high reliability, and '?' means you can install any type of server. What is the minimum inefficiency you can get after installing a server at '?'.
For example, in the string '100?001', the minimum inefficiency is 4. The inefficiency is defined as the number of adjacent pairs of servers that have different attributes.
Example
Input
100?001