Home Tags Posts tagged with "Hackerrank"
Tag:

Hackerrank

  • Strings

    Pangrams

    by nikoo28
    2 minutes read

    Question: Given a string, identify if it is a pangram. Input: The quick brown fox jumps over the lazy little dog.Output: pangram To start with the problem statement we must first understand what is a pangram. A pangram is a string that contains all the characters in the English alphabet at-least once. This means that the string ‘the quick brown fox jumps over the lazy little dog’ will cover each of the letter from ‘a-z’. So how to identify if a string is a pangram?You need to keep a check…

    0 FacebookTwitterLinkedinWhatsappEmail
  • Strings

    [HackerRank] – Two Characters

    by nikoo28
    7 minutes read

    A string is said to be valid when it has only distinct characters and none of them repeat simultaneously. For example, if string ‘s two distinct characters are x and y, then valid examples could be xyxyx or yxyxy but not xxyy or xyyx.Question: Given a sample string, we need to determine what is the maximum length of valid string that can be made by deleting any of the characters.Input: beabeefeabOutput: 5 Explanation: Let us try to understand the output for the sample test case.If we delete e and f,…

    0 FacebookTwitterLinkedinWhatsappEmail

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More