Pangrams

  • + 0 comments

    C++ Solution:

    string pangrams(string s)
    {
        unordered_map<char, int> hMap;
        for(int i = 0; i < s.size(); i++)
        {
            hMap[s[i]] = 1;
        }
    
        for(int i = 0; i < 26; i++)
        {
            if(hMap['a' + i] == 0)
            {
                if(hMap['A' + i] == 0)
                {
                    return "not pangram";
                }
            }
        }
        return "pangram";
    }