Skip to content

Commit 95e9129

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 6f74802 commit 95e9129

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

strings/longest_repeated_substring.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ def longest_repeated_substring(s: str) -> str:
99

1010
class State:
1111
__slots__ = ("next", "link", "length", "first_pos", "occ")
12+
1213
def __init__(self):
1314
self.next = {}
1415
self.link = -1
1516
self.length = 0
1617
self.first_pos = -1
17-
self.occ = 0
18+
self.occ = 0
1819

1920
st = [State()]
2021
last = 0
@@ -66,8 +67,8 @@ def sa_extend(c, pos):
6667
best_end = state.first_pos
6768
if best_len == 0:
6869
return ""
69-
return s[best_end - best_len + 1: best_end + 1]
70+
return s[best_end - best_len + 1 : best_end + 1]
7071

7172

7273
if __name__ == "__main__":
73-
print(longest_repeated_substring("banana"))
74+
print(longest_repeated_substring("banana"))

0 commit comments

Comments
 (0)