• + 0 comments

    Here is my Python solution! We find the maximum height of the letters in the word, and multiply that by the length of the word.

    def designerPdfViewer(h, word):
        height = -1
        for letter in word:
            height = max(height, h[ord(letter) - 97])
        return height * len(word)