CarlosLabs
Hackerrank Challenges - Designer PDF viewer
#!/bin/python3 import math import os import random import re import sys # Complete the designerPdfViewer function below. def designerPdfViewer(h, word): lowerA = 97 letter = list(word) maxHeight = 0 for ltr in letter: lt = (ord(ltr) - lowerA) if (h[lt] > maxHeight): maxHeight = h[lt] return (maxHeight * len(word)) if __name__ == '__main__': fptr = open(os.environ['OUTPUT_PATH'], 'w') h = list(map(int, input().rstrip().split())) word = input() result = designerPdfViewer(h, word) fptr.write(str(result) + '\n') fptr.close()