kyu_6.longest_repetition package

Submodules

kyu_6.longest_repetition.longest_repetition module

kyu_6.longest_repetition.longest_repetition.longest_repetition(chars: str) → Tuple[source]

For a given string s find the character c (or C) with longest consecutive repetition and return: (c, l)

where l (or L) is the length of the repetition. If there are two or more characters with the same l return the first.

For empty string return: (‘’, 0) :param chars: :return:

kyu_6.longest_repetition.test_longest_repetition module

class kyu_6.longest_repetition.test_longest_repetition.LongestRepetitionTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Testing longest_repetition function

test_longest_repetition()[source]

For a given string s find the character c (or C) with longest consecutive repetition and return: (c, l) where l (or L) is the length of the repetition.

For empty string return: (‘’, 0) :return:

Module contents