diff --git "a/leetcode3/\354\206\241\354\243\274\355\230\234/2452. Words Within Two Edits of Dictionary" "b/leetcode3/\354\206\241\354\243\274\355\230\234/2452. Words Within Two Edits of Dictionary" new file mode 100644 index 00000000..390298a0 --- /dev/null +++ "b/leetcode3/\354\206\241\354\243\274\355\230\234/2452. Words Within Two Edits of Dictionary" @@ -0,0 +1,17 @@ +class Solution: + def twoEditWords(self, queries: list[str], dictionary: list[str]) -> list[str]: + result = [] + + for word in queries: + for j in dictionary: + + cnt = 0 + for k in range(len(word)): + if word[k] != j[k]: + cnt +=1 + + + if cnt <= 2: + result.append(word) + break + return result