Sort by

recency

|

2765 Discussions

|

  • + 0 comments

    **Simple PYTHON Solution **

    def designerPdfViewer(h, word):
        # Write your code here
        w = "abcdefghijklmnopqrstuvwxyz"
        r = 0 
        for i in word:
            a = w.index(i)
            if r < h[a]:
                r = h[a]
        return r*(len(word))
    
  • + 1 comment

    This PDF highlighting problem reminds me of when I used PhotoCat AI to document my coding solutions! After solving a similar algorithm, I simply told PhotoCat to 'highlight the key variables in blue and enhance readability' - like magic, it transformed my messy screenshots into clean tutorials. The AI that listens and edits in conversation understood exactly what I needed. Now I use PhotoCat's free tools for all my technical visuals. It's incredible how their smart editing helps explain complex code concepts visually. The future of documentation is here - where programming meets AI-powered photo editing!

  • + 0 comments
    def designerPdfViewer(h, word):
        # Write your code here
        
        tallest = None
        letter_count = len(word)
        
        for i in word:
            index = ord(i) - 97
            current_word_height = h[index]
            
            if not tallest or tallest < current_word_height:
                tallest = current_word_height
                
        return tallest * letter_count
    
  • + 0 comments

    simple cpp solutions

    int designerPdfViewer(vector h, string word) {

    int maxheight=0;
    

    for(char c :word){ int a= c -'a'; maxheight=max(maxheight,h[a]); } int area=maxheight * word.length(); return area; }

  • + 0 comments

    Just finished helping my kid set up his new kids airbed for a sleepover! While I was at it, I stumbled upon this PDF highlighter problem—kinda fun figuring out the highlighted area based on letter heights. It’s like measuring how tall his alphabet blocks would stack up, but with numbers. The kids airbed is ready, and now I’ve got coding puzzles to keep me busy too—win-win! 😄

    (Your problem's solution is simple: find the tallest letter in the word using the given heights, then multiply that height by the word's length—since each letter is 1 unit wide. Easy peasy!)