[Python] Checkio Solution 解答 – Long Repeat




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:


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