01. Panagram Checking
Last updated
Last updated
The problem can be found at the following link: Question Link
Vector Initialization: Create a vector f
of size 26, initialized with zeros. This vector is used to keep track of the occurrence of each letter in the alphabet.
Iterate Through the String: Iterate through each character in the input string.
Convert to Lowercase: Convert the current character to lowercase.
Check if Character is a Lowercase Letter: If the character is a lowercase letter, update the corresponding index in the vector f
to 1.
Check Pangram Condition: Check if all elements in the vector f
are set to 1. This indicates that all lowercase letters are present in the input string.
Time Complexity: The time complexity is O(n), where n is the length of the input string. This is because each character is processed once.
Auxiliary Space Complexity: The auxiliary space complexity is O(1) since the size of the vector f
is constant (26).
For discussions, questions, or doubts related to this solution, please visit our discussion section. We welcome your input and aim to foster a collaborative learning environment.
If you find this solution helpful, consider supporting us by giving a ⭐ star
to the getlost01/gfg-potd repository.