PROGRAMMING:Character statistics
[problem description]
There is a fat man named Xiao Ming in the laboratory. The first day he came in, the teacher asked him to practice typing. What he started to practice is typing English letters. Xiao Ming was tired after one hour. The teacher told him not to practice any more when he saw that he was tired. But the premise is that he must know how many consecutive characters in the English letter string he typed at most? Dear students, if you sympathize with fat Xiaoming, then you can write a program for him to calculate how many consecutive characters are the same in a string? Here we assume that strings are composed of English lowercase letters, uppercase letters and numbers; The length of the string does not exceed 100000; We define "the same" as:
1: Case insensitive;
2:“0”=“a”=“A”;“ 1”=“b”=“B”;……;“ 9”=“j”=“J”;
[input and output]
Input is a line of string, output has two lines, the first line format is: "from = XX, to = XX", the second line format is: "maxlen = XX". There are multiple sets of test data for this problem. If there are more than one group of solutions that meet the requirements, the solution with the minimum starting position is output.
Sample Input:
iaaaaa000AAAAwh
Sample Output:
From=2,To=13
MaxLen=12
answer:If there is no answer, please comment
There is a fat man named Xiao Ming in the laboratory. The first day he came in, the teacher asked him to practice typing. What he started to practice is typing English letters. Xiao Ming was tired after one hour. The teacher told him not to practice any more when he saw that he was tired. But the premise is that he must know how many consecutive characters in the English letter string he typed at most? Dear students, if you sympathize with fat Xiaoming, then you can write a program for him to calculate how many consecutive characters are the same in a string? Here we assume that strings are composed of English lowercase letters, uppercase letters and numbers; The length of the string does not exceed 100000; We define "the same" as:
1: Case insensitive;
2:“0”=“a”=“A”;“ 1”=“b”=“B”;……;“ 9”=“j”=“J”;
[input and output]
Input is a line of string, output has two lines, the first line format is: "from = XX, to = XX", the second line format is: "maxlen = XX". There are multiple sets of test data for this problem. If there are more than one group of solutions that meet the requirements, the solution with the minimum starting position is output.
Sample Input:
iaaaaa000AAAAwh
Sample Output:
From=2,To=13
MaxLen=12
answer:If there is no answer, please comment