[Python] Checkio Solution 解答 – Long Repeat

Level:

Elementary

Problem:

This mission is the first one of the series. Here you should find the length of the longest substring that consists of the same letter. For example, line “aaabbcaaaa” contains four substrings with the same letters “aaa”, “bb”,”c” and “aaaa”. The last substring is the longest one which makes it an answer.

Input: String.

Output: Int.

 

Source: https://py.checkio.org


My Solution:


Comment:

The Checkio system even check your code using empty string. Sometimes when we solve a problem, we do need to consider different situations.