Multiple sets of input. Each group just one line, s, represents the menu sequence.All the letters are uppercase and within {A,B,C,D,E,F,G,H,I,J}. 1≤|s|≤1e5。
请先登录再刷题,不会做的题目右上可以查看题解和答案~
Multiple sets of input. Each group just one line, s, represents the menu sequence.All the letters are uppercase and within {A,B,C,D,E,F,G,H,I,J}. 1≤|s|≤1e5。
Output an integer indicating the minimum amount of time you need to spend planting.
EIGJBB
9
The sample explain: farm planting situation (The serial number 1 indicates the ingredient grown on the earliest farmland, the serial number 2 indicates the second earliest, and the serial number 3 indicates the latest) : 1 2 3 a b b b c c c c c c a b a b a a b a The order in which ingredients are grown: abbcccaba.