diff options
author | terminaldweller <thabogre@gmail.com> | 2022-07-29 05:22:23 +0000 |
---|---|---|
committer | terminaldweller <thabogre@gmail.com> | 2022-07-29 05:22:23 +0000 |
commit | ae2a1da68a95f7e90e449f6035132021693bbcf7 (patch) | |
tree | a0b893107a8707cbbc5a2b34b2cd73584e7603a2 /890 | |
parent | update (diff) | |
download | leetcode-ae2a1da68a95f7e90e449f6035132021693bbcf7.tar.gz leetcode-ae2a1da68a95f7e90e449f6035132021693bbcf7.zip |
update
Diffstat (limited to '890')
-rwxr-xr-x | 890/main.py | 8 |
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 = [] |