Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f4efe93

Browse files
committedOct 12, 2024·
Resolved merge conflict in wildcard_pattern_matching_fft.py
1 parent 9d6751c commit f4efe93

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎strings/wildcard_pattern_matching_fft.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ def preprocess_text_and_pattern(text: str, pattern: str) -> tuple[list[int], lis
1212
Returns:
1313
A tuple containing:
1414
- A list of integers representing the text characters.
15-
- A list of integers representing the pattern characters, with 0 for wildcards.
15+
- A list of integers representing the pattern characters,
16+
with 0 for wildcards.
1617
"""
1718

1819
unique_chars = set(text + pattern)
@@ -52,7 +53,7 @@ def compute_a_fft(text_int: list[int], pattern_int: list[int]) -> np.ndarray:
5253
pattern_int: The integer representation of the pattern.
5354
5455
Returns:
55-
The A array.
56+
The a array.
5657
"""
5758

5859
n = len(text_int)
@@ -75,7 +76,7 @@ def compute_a_fft(text_int: list[int], pattern_int: list[int]) -> np.ndarray:
7576
# Calculate a[i] using the convolution results
7677
a = sum1[:n - m + 1] - 2 * sum2[:n - m + 1] + sum3[:n - m + 1]
7778
# Calculate A[i] using the convolution results
78-
A = sum1[: n - m + 1] - 2 * sum2[: n - m + 1] + sum3[: n - m + 1]
79+
a = sum1[: n - m + 1] - 2 * sum2[: n - m + 1] + sum3[: n - m + 1]
7980

8081
return a
8182

0 commit comments

Comments
 (0)
Please sign in to comment.