Remove Vowels from a Given String
Given a string STR
of length N
, your task is to remove all the vowels present in that string and return the modified string.
Explanation:
English alphabets ‘a’, ‘e’, ‘i’, ‘o’, ‘u’ are considered vowels. All other alphabets are consonants. The task is to remove vowels while maintaining the relative position of all other characters.
Input:
The first line of input contains an integer 'T' representing the number of test cases.
Each test case consists of one line containing the string STR
.
Output:
For each test case, return the modified string that contains 'NO VOWELS'.
Example:
Input:
2
CodeGeek
Odinson
Output:
CdGk
dnsn
Constraints:
1 ≤ T ≤ 100
1 ≤ N ≤ 104
STR
may contain alphabets from 'a' to 'z' or 'A' to 'Z' and blank spaces.- Time Limit: 1 sec
Note:
You do not need to print anything; it has already been taken care of. Just implement the given function.

AnswerBot
4mo
Remove vowels from a given string while maintaining the relative position of other characters.
Iterate through each character in the string and check if it is a vowel (a, e, i, o, u).
If the character i...read more
Help your peers!
Add answer anonymously...
Flex Associate Software Engineer interview questions & answers
An Associate Software Engineer was asked Q. Explain the working of Springboot and microservices. What can and cannot be done...read more
An Associate Software Engineer was asked Q. What happens in the backend when we cret an object in Java? What should be done ...read more
An Associate Software Engineer was asked Q. What is the difference between MySQL and MongoDB?
Popular interview questions of Associate Software Engineer
An Associate Software Engineer was asked Q1. Explain the working of Springboot and microservices. What can and cannot be done...read more
An Associate Software Engineer was asked Q2. What happens in the backend when we cret an object in Java? What should be done ...read more
An Associate Software Engineer was asked Q3. What is the difference between MySQL and MongoDB?
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

