kyu_6.longest_repetition package

Submodules

kyu_6.longest_repetition.longest_repetition module

Solution for -> First character that repeats.

Created by Egor Kostan. GitHub: https://github.com/ikostan

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

Longest repetition.

For a given string s find the character c (or C) with the 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

Test for -> First character that repeats.

Created by Egor Kostan. GitHub: https://github.com/ikostan

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

Bases: TestCase

Testing longest_repetition function.

_classSetupFailed = False
_class_cleanups = []
test_longest_repetition = None
test_longest_repetition_0_aaaabb(**kw)

Test ‘longest_repetition’ with various test data [with string=’aaaabb’, expected=(‘a’, 4)].

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

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

test_longest_repetition_1_bbbaaabaaaa(**kw)

Test ‘longest_repetition’ with various test data [with string=’bbbaaabaaaa’, expected=(‘a’, 4)].

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

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

test_longest_repetition_2_cbdeuuu900(**kw)

Test ‘longest_repetition’ with various test data [with string=’cbdeuuu900’, expected=(‘u’, 3)].

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

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

test_longest_repetition_3_abbbbb(**kw)

Test ‘longest_repetition’ with various test data [with string=’abbbbb’, expected=(‘b’, 5)].

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

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

test_longest_repetition_4_aabb(**kw)

Test ‘longest_repetition’ with various test data [with string=’aabb’, expected=(‘a’, 2)].

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

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

test_longest_repetition_5_ba(**kw)

Test ‘longest_repetition’ with various test data [with string=’ba’, expected=(‘b’, 1)].

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

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

test_longest_repetition_6_(**kw)

Test ‘longest_repetition’ with various test data [with string=’’, expected=(‘’, 0)].

For a given string s find the character c (or C) with the 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

Character with longest consecutive repetition.