Given a word of length less than 10, the task is to find a number of ways in which it can be arranged without changing the relative position of vowel and consonants.
Input: "GEEKS" Output: 6 Input: "COMPUTER" Output: 720
- Count the vowels and consonants in the word
- Now find total number of ways to arrange vowel only
- Then find ways to arrange consonant only.
- Multiply both answer to get the Total ways = (no of ways to arrange vowel only)*(no of ways to arrange consonant only)
Below is the implementation of the above approach:
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Find the number of words of X vowels and Y consonants that can be formed from M vowels and N consonants
- Substrings starting with vowel and ending with consonants and vice versa
- Replace consonants with next immediate consonants alphabetically in a String
- Number of words that can be made using exactly P consonants and Q vowels from the given string
- Count strings with consonants and vowels at alternate position
- Removing a number from array without changing its arithmetic mean
- Seating arrangement of n boys and girls alternatively around a round table
- Count words that appear exactly two times in an array of words
- Check if the given string of words can be formed from words present in the dictionary
- Find the arrangement of queue at given time
- Maximum height of triangular arrangement of array values
- Arrangement of the characters of a word such that all vowels are at odd places
- Seating arrangement of N boys sitting around a round table such that two particular boys sit together
- Reorder the position of the words in alphabetical order
- Alternate vowel and consonant string
- Print all Subsequences of String which Start with Vowel and End with Consonant.
- Lexicographically first alternate vowel and consonant string
- Count of N size strings consisting of at least one vowel and one consonant
- Python program to check if given string is vowel Palindrome
- Count of adjacent Vowel Consonant Pairs
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.