mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-25 10:28:39 +00:00
Fix ruff formatting in if statements
This commit is contained in:
parent
7271e3d2a5
commit
4456366da0
@ -82,11 +82,11 @@ def dp_match(text: str, pattern: str) -> bool:
|
||||
|
||||
for i in range(1, m + 1):
|
||||
for j in range(1, n + 1):
|
||||
if pattern[j - 1] == "." or pattern[j - 1] == text[i - 1]:
|
||||
if pattern[j - 1] in {".", text[i - 1]}:
|
||||
dp[i][j] = dp[i - 1][j - 1]
|
||||
elif pattern[j - 1] == "*":
|
||||
dp[i][j] = dp[i][j - 2]
|
||||
if pattern[j - 2] == "." or pattern[j - 2] == text[i - 1]:
|
||||
if pattern[j - 2] in {".", text[i - 1]}:
|
||||
dp[i][j] |= dp[i - 1][j]
|
||||
else:
|
||||
dp[i][j] = False
|
||||
|
Loading…
x
Reference in New Issue
Block a user