HackerRank: Designer PDF Viewer (Easy)

Link to code challenge
function designerPdfViewer(h, word) { let max = 0; for (let i = 0; i < word.length; i++) { let numEq = word[i].charCodeAt() - 96 - 1; if (h[numEq] > max) max = h[numEq]; } return max * word.length; }

Comments

Popular posts from this blog

Code Wars: Data Reverse (6 kyu)

Code Wars: longest_palindrome (6 kyu)

Code Wars: Find the odd int