Given a string S of size n. The task is to check whether the given string contain panalphabetic window. A Panalphabetic window is a stretch of text that contains all the letters of the alphabet in order.
Input : S = "abujm zvcd acefc deghf gijkle m n o p pafqrstuvwxyzfap" Output : YES Panalphabetic Window is in Bold: abujm zvcd acefc deghf gijkle m n o p pafqrstuvwxyzfap Input : S = "geeksforgeeks" Output : NO
The idea is to initialise a varible, say ch, to ‘a’. Start traversing the given string from the beginning and increment the variable ch by 1, if we find a character equal to ch else move to next index. When the string is over check whether ch is equal to ‘z’ + 1, if yes, return true, else return false.
Below is implementation of this approach:
- Find the smallest window in a string containing all characters of another string
- Smallest window that contains all characters of string itself
- Python | Get the smallest window in a string containing all characters of given pattern
- String slicing in Python to check if a string can become empty by recursive deletion
- Minimal moves to form a string by adding characters or appending string itself
- Lexicographically smallest string formed by appending a character from the first K characters of a given string
- Find the longest sub-string which is prefix, suffix and also present inside the string
- Create a new string by alternately combining the characters of two halves of the string in reverse
- Find the count of palindromic sub-string of a string in its sorted form
- Find the character in first string that is present at minimum index in second string
- Find length of longest subsequence of one string which is substring of another string
- Given a string and an integer k, find the kth sub-string when all the sub-strings are sorted according to the given condition
- Minimum deletions from string to reduce it to string with at most 2 unique characters
- Check if a string can be converted to another string by replacing vowels and consonants
- Minimum number of given operations required to convert a string to another string
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : manishshaw1