• + 38 comments

    To simplify, it can be solved using short elegant code in Python :

    size = [int(i) for i in input().split()]
    word = [size[ord(c)-ord('a')] for c in input()]
    print(max(word)*len(word))
    


    Informative Tweets for Inquisitive Minds