Skip to content

Commit c91d268

Browse files
Merge pull request #1856 from CodingTestStudy2/최민지
[최민지] Day20
2 parents ec58c4c + 0f6e3d0 commit c91d268

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)