• + 1 comment

    TypeScript one-liner:

    function designerPdfViewer(h: number[], word: string): number {
      return Array.from(new Set(word.split(""))).reduce((acc, curr) => Math.max(h[curr.charCodeAt(0) - 97], acc), 0) * word.length;
    }