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: String incrementer

Code Wars: Replace With Alphabet Position

Code Wars: Find the odd int