You are viewing a single comment's thread. Return to all comments →
My JS solution
function designerPdfViewer(h, word) { const alphabet = 'abcdefghijklmnopqrstuvwxyz'; let maxValue = 0; for(const char of word) { if (maxValue < h[alphabet.indexOf(char)]) maxValue = h[alphabet.indexOf(char)]; } return maxValue * word.length; }
Seems like cookies are disabled on this browser, please enable them to open this website
Designer PDF Viewer
You are viewing a single comment's thread. Return to all comments →
My JS solution
function designerPdfViewer(h, word) { const alphabet = 'abcdefghijklmnopqrstuvwxyz'; let maxValue = 0; for(const char of word) { if (maxValue < h[alphabet.indexOf(char)]) maxValue = h[alphabet.indexOf(char)]; } return maxValue * word.length; }