From ae2a1da68a95f7e90e449f6035132021693bbcf7 Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Fri, 29 Jul 2022 09:52:23 +0430 Subject: update --- 890/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to '890/main.py') 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 = [] -- cgit v1.2.3