Given a string str consisting of alphanumeric characters, the task is to check whether the string contains all the digits from 1 to 9.
Input: str = “Geeks12345for69708”
All the digits from 0 to 9 are
present in the given string.
Input: str = “Amazing1234”
Approach: Create a frequency array to mark the frequency of each of the digits from 0 to 9. Finally, traverse the frequency array and if there is any digit that is not present in the given string then the answer will be “No” else the answer will be “Yes”.
Below is the implementation of the above approach:
- Check if the frequency of all the digits in a number is same
- Check if the Xor of the frequency of all digits of a number N is zero or not
- String slicing in Python to check if a string can become empty by recursive deletion
- Check if a string can be converted to another string by replacing vowels and consonants
- Number of even substrings in a string of digits
- Queries to check if string B exists as substring in string A
- Check if a string can become empty by recursively deleting a given sub-string
- Check if a string can be obtained by rotating another string d places
- Check if a string can be obtained by rotating another string 2 places
- Check if a string can be repeated to make another string
- Check whether second string can be formed from characters of first string
- Check if the given string is shuffled substring of another string
- Check if a string contains a palindromic sub-string of even length
- Program to count vowels, consonant, digits and special characters in string.
- Check if a given string is sum-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.