Sort by

recency

|

2728 Discussions

|

  • + 0 comments

    Java Solution:

    public static int designerPdfViewer(List<Integer> h, String word) {
        int maxHeight = 0;
    
        for (int i = 0; i < word.length(); i++) {
            int index = ((int) word.charAt(i)) - 97;
            if (maxHeight < h.get(index)) {
                maxHeight = h.get(index);
            }
        }
    
        return maxHeight * word.length();
    }
    
  • + 0 comments

    C#

        {
            int max = int.MinValue;
            
            foreach (char c in word){
                int i = ((int)c % 32)-1;
                if (h[i] > max){
                    max = h[i];
                }
            }
            
            return (max * word.Length);
        }
    
  • + 0 comments

    Here is my Python solution! We find the maximum height of the letters in the word, and multiply that by the length of the word.

    def designerPdfViewer(h, word):
        height = -1
        for letter in word:
            height = max(height, h[ord(letter) - 97])
        return height * len(word)
    
  • + 0 comments

    Java Solution

    class Result {
    
        /*
         * Complete the 'designerPdfViewer' function below.
         *
         * The function is expected to return an INTEGER.
         * The function accepts following parameters:
         *  1. INTEGER_ARRAY h
         *  2. STRING word
         */
    
        public static int designerPdfViewer(List<Integer> h, String word) {
        // Write your code here
            String alpha = "abcdefghijklmnopqrstuvwxyz";
            int max = 0;
             int len = word.length();
             
            for(int i = 0; i < len; i++)
            {
                char curr = word.charAt(i); //t
                for(int j = 0; j< alpha.length(); j++)
                {
                    char cu = alpha.charAt(j);
                    if(curr == cu)
                    {
                        if(h.get(j) > max)
                        {
                            max = h.get(j);
                        }
                    }
                }
            }
           
            return len * max;
            
            
            
            
        }
    
    }
    
  • + 0 comments

    Designer PDF Viewer is a specialized tool that allows users to view PDF documents with enhanced customization and display features. Unlike traditional PDF viewers, this type of software is tailored for users who need more refined control over the presentation of documents, such as graphic designers, architects, and professionals handling visually rich files. Designer PDF Viewers often come with options for zooming, panning, and adjusting color schemes to ensure precision in reviewing intricate xalaflixapk layouts or illustrations vinyl wrap auto. With support for high-resolution content and interactive elements, these viewers enhance productivity by offering a seamless experience for analyzing and presenting detailed digital documents.