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 variable, 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:
- Return maximum occurring character in an input string
- Print all the duplicates in the input string
- Remove characters from the first string which are present in the second string
- Remove duplicates from a given string
- Print reverse of a string using recursion
- Write a program to print all permutations of a given string
- Divide a string in N equal parts
- Given a string, find its first non-repeating character
- Write a program to reverse an array or string
- Reverse words in a given string
- Find the smallest window in a string containing all characters of another string
- Lexicographic rank of a string
- An in-place algorithm for String Transformation
- Count words in a given string
- String matching where one string contains wildcard characters
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.