General Coding Problems
General Coding Problems
40problems · Write code, run tests, and submit solutions
Coding Practice
Select a language, write your solution, and click Run to test.
Click Submit to evaluate your code against all test cases.
Mark a problem as completed when you're done.
0/40 done
Problem 1 of 40
Problem 1Easy ·
Write a program to count vowels and consonants in a string.
fn countVowelsConsonants(s: &str) -> (usize, usize)
Sample #1
Input: hello world
Expected: 3 7
Sample #2
Input: AEIOU
Expected: 5 0
Test #3
Input: bcdfg
Expected: 0 5
Test #4
Input: Programming
Expected: 3 8
View Solution & Explanation
Iterate through characters, check alphabets, and count vowels separately from consonants.
All Problems