From 0094577a48b494bcbaadfaffe450f7cb86ff89da Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 19 Oct 2024 06:54:37 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- divide_and_conquer/Suffix Array and LCP implementation.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/divide_and_conquer/Suffix Array and LCP implementation.py b/divide_and_conquer/Suffix Array and LCP implementation.py index c97197824..fa4230db5 100644 --- a/divide_and_conquer/Suffix Array and LCP implementation.py +++ b/divide_and_conquer/Suffix Array and LCP implementation.py @@ -47,7 +47,9 @@ class SuffixArray: for i in range(n): if rank[i] > 0: j = suffix_array[rank[i] - 1] - while (i + h < n) and (j + h < n) and self.text[i + h] == self.text[j + h]: + while ( + (i + h < n) and (j + h < n) and self.text[i + h] == self.text[j + h] + ): h += 1 lcp[rank[i]] = h if h > 0: @@ -83,7 +85,8 @@ class SuffixArray: print("\nLCP Array:") for i in range(1, len(self.lcp_array)): print( - f"LCP between {self.text[self.suffix_array[i - 1]:]} and {self.text[self.suffix_array[i]:]}: {self.lcp_array[i]}") + f"LCP between {self.text[self.suffix_array[i - 1]:]} and {self.text[self.suffix_array[i]:]}: {self.lcp_array[i]}" + ) # Example usage: