https://www.hackerrank.com/challenges/designer-pdf-viewer
The first line contains 26 space-separated integers describing the respective heights of each consecutive lowercase English letters.
The second line contains a single word, consisting of lowercase English alphabetic letters.
1 3 1 3 1 4 1 3 2 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
abc
In [5]:
h = [int(i) for i in input().strip().split(" ")]
word = input().strip()
h = dict(zip([chr(i+97) for i in range(26)], h))
maxH = None
for i in word:
if maxH == None or h[i] > maxH:
maxH = h[i]
print(maxH * len(word))
In [ ]: