There was an error while loading. Please reload this page.
2 parents ec58c4c + 0f6e3d0 commit c91d268Copy full SHA for c91d268
1 file changed
leetcode3/최민지/3838-weighted-word-mapping.py
@@ -0,0 +1,12 @@
1
+class Solution:
2
+ def mapWordWeights(self, words: List[str], weights: List[int]) -> str:
3
+ weight_alpha = []
4
+ for word in words:
5
+ word_sum = 0
6
+
7
+ for w in word:
8
+ word_sum += weights[ord(w)-ord('a')]
9
+ weight_alpha.append(chr(ord('z') - word_sum % 26))
10
+ return ''.join(weight_alpha)
11
12
0 commit comments