Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a10121a

Browse files
authored
Solution
1 parent 3f5bbfb commit a10121a

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/python3
2+
3+
import math
4+
import os
5+
import random
6+
import re
7+
import sys
8+
9+
# Complete the designerPdfViewer function below.
10+
def designerPdfViewer(h, word):
11+
maxi=0
12+
for i in range(len(word)):
13+
if(maxi< h[ord(word[i])-97]):
14+
maxi = h[ord(word[i])-97]
15+
return maxi*len(word)
16+
17+
if __name__ == '__main__':
18+
fptr = open(os.environ['OUTPUT_PATH'], 'w')
19+
20+
h = list(map(int, input().rstrip().split()))
21+
22+
word = input()
23+
24+
result = designerPdfViewer(h, word)
25+
26+
fptr.write(str(result) + '\n')
27+
28+
fptr.close()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /