• + 0 comments

    Here is my c++ solution, you can watch the explanation here : https://youtu.be/tRUU2pSf8fI

    int designerPdfViewer(vector<int> h, string word) {
        int mx = 0;
        for(int el : word) if(h[el - 'a'] > mx) mx = h[el - 'a'];
        return mx * 1 * word.size();
    }