Skip to content

Commit

Permalink
repair a bug
Browse files Browse the repository at this point in the history
zhouchengjie committed Dec 30, 2020
1 parent 85ee86a commit 29f0fd2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/LAC/prefix_tree.py
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ def search(self, content):
result = []
length = len(content)
for start in range(length):
for end in range(start+1, length):
for end in range(start+1, length+1):
pos = self.tree.get(content[start:end], -1)
if pos == -1:
break
@@ -71,7 +71,7 @@ def search_all(self, content):

length = len(content)
for start in range(length):
for end in range(start+1, length):
for end in range(start+1, length+1):
pos = self.tree.get(content[start:end], -1)
if pos == -1:
break

0 comments on commit 29f0fd2

Please sign in to comment.