[最佳答案] I'm assuming that you are looking for the length of the shortest possible string that can be obtained after reduction. A simple solution would be to explore all possibilities in a greedy manner and hope that it does not explode exponentially. I'm gonna write Python pseudocode here because that's easier to comprehend (at least for me ;)): from collections import deque def try_reduce(string): queue = deque([string]) min_length = len(string) while queue: string = queue.popleft() if len(string) <