• + 0 comments

    php solution:

    function designerPdfViewer($h, $word) {
         // Write your code here
        $alphabet_lowercase = range('a', 'z');
        $word = str_split($word);
        
        $max_height = 0;
        foreach($word as $w) {
            $index = array_search($w, $alphabet_lowercase);
            if ($h[$index] > $max_height) {
                $max_height = $h[$index];
            }
        }
        $size = $max_height * count($word);
        
        return $size;
    }