Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit ccdebde

Browse files
committed
Updated sequences packages
Updated imports on package initialization. Updated docstrings in functions.
1 parent b81b4d7 commit ccdebde

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/sequences/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,7 @@
3838
"is_palindrome",
3939
"get_longest_palindrome",
4040
"are_parentheses_balanced",
41+
"get_fibonacci_number",
42+
"get_longest_uniq_length",
43+
"get_sum_of_strings",
4144
]

src/sequences/func.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ def is_palindrome(origin: str) -> bool:
5454

5555

5656
def get_longest_palindrome(origin: str) -> str:
57-
# noinspection SpellCheckingInspection
5857
"""Return the longest palindrome substring from the given input
5958
6059
:param origin:
@@ -65,7 +64,8 @@ def get_longest_palindrome(origin: str) -> str:
6564
6665
Usage examples:
6766
68-
>>> assert get_longest_palindrome("ABBABBC") == "BBABB"
67+
>>> assert get_longest_palindrome("0123219") == "12321"
68+
>>> assert get_longest_palindrome("1012210") == "012210"
6969
7070
"""
7171

@@ -169,17 +169,17 @@ def get_fibonacci_number(idx: int) -> int:
169169
def get_longest_uniq_length(origin: str) -> int:
170170
"""Return the length of the longest on sequence of unique characters
171171
172-
Usage examples:
173-
174-
>>> assert get_longest_uniq_length("abcdefg") == 7
175-
>>> assert get_longest_uniq_length("abcacba") == 3
176-
177172
:param origin: original sequences
178173
:type origin: str
179174
180175
:return: the length of the longest unique characters sequence
181176
:rtype: int
182177
178+
Usage examples:
179+
180+
>>> assert get_longest_uniq_length("abcdefg") == 7
181+
>>> assert get_longest_uniq_length("racecar") == 4
182+
183183
"""
184184

185185
length: int = 0

0 commit comments

Comments
 (0)