-
Notifications
You must be signed in to change notification settings - Fork 495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
typo in sa_lcp.py #73
Comments
sorry for the bad formatting idk how to link the file with line https://github.com/stevenhalim/cpbook-code/blob/master/ch6/sa_lcp.py |
You're right that To show specific line see https://docs.github.com/en/github/managing-your-work-on-github/creating-a-permanent-link-to-a-code-snippet. In this case it's
which would be rendered as Lines 88 to 96 in 0ba81b4
|
in this file it does not seem that we are using globals so in this code m is missing as a parameter (n is also missing but in main its defined as just len of the string)
def longest_common_substring(sa, lcp):
idx = 0
max_lcp = -1
for i in range(1, n):
if (sa[i] < m) != (sa[i-1] < m) and lcp[i] > lcs:
max_lcp = lcp[i]
idx = i
return (max_lcp, idx)
The text was updated successfully, but these errors were encountered: