kyu_6.string_subpattern_recognition_3 package
Submodules
kyu_6.string_subpattern_recognition_3.has_subpattern module
Solution for -> String subpattern recognition III.
Created by Egor Kostan. GitHub: https://github.com/ikostan
- kyu_6.string_subpattern_recognition_3.has_subpattern.has_subpattern(string: str) str[source]
Recognition of string subpattern III.
Since there is no deterministic way to tell which pattern was really the original one among all the possible permutations of a fitting subpattern, return a subpattern with sorted characters, otherwise return the base string with sorted characters (you might consider this case as an edge case, with the subpattern being repeated only once and thus equalling the original input string). :param string: :return:
kyu_6.string_subpattern_recognition_3.test_has_subpattern module
Test for -> String subpattern recognition III.
Created by Egor Kostan. GitHub: https://github.com/ikostan
- class kyu_6.string_subpattern_recognition_3.test_has_subpattern.HasSubpatternTestCase(methodName='runTest')[source]
Bases:
TestCaseTesting ‘has_subpattern’ function.
- _classSetupFailed = False
- _class_cleanups = []
- test_has_subpattern()[source]
Verify that ‘has_subpattern’ function.
Return a subpattern with sorted characters, otherwise return the base string with sorted characters (you might consider this case as an edge case, with the subpattern being repeated only once and thus equalling the original input string). :return:
Module contents
String subpattern recognition III.