MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / palindromic_length

Function palindromic_length

strings/manacher.py:2–5  ·  view source on GitHub ↗
( center, diff, string)

Source from the content-addressed store, hash-verified

1# calculate palindromic length from center with incresmenting difference
2def palindromic_length( center, diff, string):
3 if center-diff == -1 or center+diff == len(string) or string[center-diff] != string[center+diff] :
4 return 0
5 return 1 + palindromic_length(center, diff+1, string)
6
7def palindromic_string( input_string ):
8 """

Callers 1

palindromic_stringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected