Beats 100.00% of user || Step by Step Explain || Easy to Understand || Using Hashtable ||
Abhiraj Pratap Singh \n\n---\n\n# if you like the solution please UPVOTE it .....\n\n---\n\n# Intuition\n Describe your first thoughts on how to solve this prob
# Abhiraj Pratap Singh \n\n---\n\n# if you like the solution please UPVOTE it .....\n\n---\n\n# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n- The code checks whether the input string sentence is a pangram or not.\n---\n\n![Screenshot (47).png](https://assets.leetcode.com/users/images/ff8032d4-f75f-4f3c-a654-1717671d5cc6_1706804137.2119575.png)\n\n---\n# Approach\n<!-- Describe your approach to solving the problem. -->\n- Initialize an array arr of size 26 (assuming only lowercase English letters) with all elements set to 0.\n- Iterate through each character in the sentence.\n- Increment the corresponding element in the array for each encountered character.\n- Check if any element in the array is still 0, indicating a missing letter in the sentence.\n- If any element is 0, return false; otherwise, return true.\n\n---\n\n# Complexity\n\n- **Time complexity:** O(n), where n is the length of the input string sentence.\n\n- **Space complexity:** O(1) since the size of the array arr is fixed at 26, and it does not depend on the input size.\n\n---\n# Code\n```\nclass Solution {\npublic:\n    bool checkIfPangram(string sentence) \n    {\n        int arr[26] = { 0 } ;\n        for( int i=0 ; i < sentence.length() ; i++ )\n            arr[ sentence[i]-\'a\' ]++;\n        for( int i=0 ; i < 26 ; i++ )\n        {\n            if( arr[i] == 0 )\n                return false ;\n        }    \n        return true;\n    }\n};\n```\n\n---\n# if you like the solution please UPVOTE it .....\n\n---\n![discord-discordgifemoji.gif](https://assets.leetcode.com/users/images/960bf9ab-18d8-40f8-8f10-fdd5060b01ab_1706804308.1449435.gif)\n![fucking-die-redditor-stupid-cuck-funny-cat.gif](https://assets.leetcode.com/users/images/8769323a-ed8a-4c4d-bfb3-0544706d72f5_1706804313.8414612.gif)\n\n---\n
['Hash Table', 'String', 'String Matching', 'C++']