aboutsummaryrefslogtreecommitdiffstats
path: root/890
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2022-07-29 05:22:23 +0000
committerterminaldweller <thabogre@gmail.com>2022-07-29 05:22:23 +0000
commitae2a1da68a95f7e90e449f6035132021693bbcf7 (patch)
treea0b893107a8707cbbc5a2b34b2cd73584e7603a2 /890
parentupdate (diff)
downloadleetcode-ae2a1da68a95f7e90e449f6035132021693bbcf7.tar.gz
leetcode-ae2a1da68a95f7e90e449f6035132021693bbcf7.zip
update
Diffstat (limited to '890')
-rwxr-xr-x890/main.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/890/main.py b/890/main.py
index 2082679..10aa9e6 100755
--- a/890/main.py
+++ b/890/main.py
@@ -6,11 +6,11 @@ from typing import List
class Solution:
@staticmethod
def findAndReplacePattern(words: List[str], pattern: str) -> List[str]:
- def match(w):
- m1, m2 = {}, {}
+ def match(word):
+ map1, map2 = {}, {}
return all(
- (m1.setdefault(i, j), m2.setdefault(j, i)) == (j, i)
- for i, j in zip(w, pattern)
+ (map1.setdefault(i, j), map2.setdefault(j, i)) == (j, i)
+ for i, j in zip(word, pattern)
)
results = []