Consonant Counting Problem Statement
Given a string STR
comprising uppercase and lowercase characters and spaces, your task is to count the number of consonants in the string.
A consonant is defined as an English alphabet character that is not a vowel (a, e, i, o, or u). Examples of consonants include b, c, d, f, etc.
Example:
Input:
STR = 'Coding Ninjas'
Output:
8
Explanation:
The given string contains 8 consonants: 'C', 'd', 'n', 'g', 'N', 'n', 'j', 's'. These characters are not part of the vowel set.
Constraints:
1 ≤ T ≤ 50
1 ≤
Length ofSTR ≤ 104
- The string consists of uppercase and lowercase letters and spaces.
- Time Limit: 1 sec

AnswerBot
4mo
Count the number of consonants in a given string containing uppercase and lowercase characters and spaces.
Iterate through each character in the string and check if it is a consonant (not a vowel).
Keep...read more
Help your peers!
Add answer anonymously...
Optum Global Solutions Software Engineer interview questions & answers
A Software Engineer was asked 3mo agoQ. What is the process for implementing a linked list?
A Software Engineer was asked 3mo agoQ. What is an IoC (Inversion of Control) container?
A Software Engineer was asked Q. How can you arrange an array in decreasing order without using extra space, a so...read more
Popular interview questions of Software Engineer
A Software Engineer was asked 3mo agoQ1. What is the process for implementing a linked list?
A Software Engineer was asked Q2. How can you arrange an array in decreasing order without using extra space, a so...read more
A Software Engineer was asked Q3. Given the head of a singly linked list, sort the list using insertion sort, and ...read more
Top HR questions asked in Optum Global Solutions Software Engineer
A Software Engineer was asked 4mo agoQ1. Rate your proficiency in the technologies listed in your skills.
A Software Engineer was asked Q2. Why do you want to join?
A Software Engineer was asked Q3. Explain your projects and work.
>
Optum Global Solutions Software Engineer Interview Questions
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

