From 0f6e3d0cd4df4b93b84d18d749c1dbd91ca23e23 Mon Sep 17 00:00:00 2001 From: choiminji Date: Tue, 18 Aug 2026 22:39:06 +0900 Subject: [PATCH] Day20 --- .../3838-weighted-word-mapping.py" | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 "leetcode3/\354\265\234\353\257\274\354\247\200/3838-weighted-word-mapping.py" diff --git "a/leetcode3/\354\265\234\353\257\274\354\247\200/3838-weighted-word-mapping.py" "b/leetcode3/\354\265\234\353\257\274\354\247\200/3838-weighted-word-mapping.py" new file mode 100644 index 00000000..5f379ec3 --- /dev/null +++ "b/leetcode3/\354\265\234\353\257\274\354\247\200/3838-weighted-word-mapping.py" @@ -0,0 +1,12 @@ +class Solution: + def mapWordWeights(self, words: List[str], weights: List[int]) -> str: + weight_alpha = [] + for word in words: + word_sum = 0 + + for w in word: + word_sum += weights[ord(w)-ord('a')] + weight_alpha.append(chr(ord('z') - word_sum % 26)) + return ''.join(weight_alpha) + + \ No newline at end of file