• + 0 comments

    Java solution:

    public static int designerPdfViewer(List<Integer> h, String word) {
        int asciiOffset = 97;
        int max = h.get(word.charAt(0) - asciiOffset);
        
        for(int i = 1; i < word.length(); i++) {
            if(max < h.get(word.charAt(i) - asciiOffset)) {
                max = h.get(word.charAt(i) - asciiOffset);
            }
        }
        return word.length() * max;
        }