← 返回 salesforce 的题目列表Minimum Replacements to Make Adjacent Characters Unequal
类型:online_judge
salesforce
Given a string, write an algorithm to insert the minimum number of replacement characters such that no two adjacent characters are the same. Return the number of replacements needed and the resulting string. For example, input: 'aaa', output: 1, 'aba'.
Example
Input
aaa