Fix word typos in comments (#4928)

* fixed: spelling

nonegative -> non-negative

* fixed: spelling

transpostiion -> transposition

* fixed: spelling

topolical -> topological

* fixed: spelling

sufix -> suffix
This commit is contained in:
Sarvesh Kumar Dwivedi
2021-10-04 09:37:58 +05:30
committed by GitHub
parent d530d2bcf4
commit 90db98304e
4 changed files with 5 additions and 5 deletions

View File

@ -14,7 +14,7 @@ Time Complexity: O(n) - where n is the length of the string
def prefix_function(input_string: str) -> list:
"""
For the given string this function computes value for each index(i),
which represents the longest coincidence of prefix and sufix
which represents the longest coincidence of prefix and suffix
for given substring (input_str[0...i])
For the value of the first element the algorithm always returns 0
@ -45,7 +45,7 @@ def prefix_function(input_string: str) -> list:
def longest_prefix(input_str: str) -> int:
"""
Prefix-function use case
Finding longest prefix which is sufix as well
Finding longest prefix which is suffix as well
>>> longest_prefix("aabcdaabc")
4