Jobs
Interviews

Solve Sort by Vowel Count using C Language

Solve Sort by Vowel Count using C to enhance your skills with c coding practice , master coding concepts, and prepare for interviews with practical exercises and detailed solutions.

Sort by Vowel Count

Difficulty : Easy

Categories :

  • Sorting algorithms

Given a list of strings words, where each word consists of lowercase English letters, sort the list according to the following rules:

  • Primary sorting is by the number of vowels in the word, counting every occurrence (in ascending order)
  • If two words have the same number of vowels, sort them lexicographically (normal dictionary order)

Note: The vowels are 'a', 'e', 'i', 'o', and 'u'.

Constraints:

  • 1 ≤ words.length ≤ 1000
  • 1 ≤ words[i].length ≤ 100
  • words[i] consists of only lowercase English letters

Examples:

Input: words = ["hello","world","leetcode"]
Output: ["world","hello","leetcode"]
Explanation:
"world" has 1 vowel ('o')
"hello" has 2 vowels ('e','o')
"leetcode" has 4 vowels ('e','e','o','e')
Input: words = ["area","lead","eat"]
Output: ["eat","lead","area"]
Explanation:
"eat" and "lead" have 2 vowels each, so they come first, in dictionary order
"area" has 3 vowels ('a','e','a')

Coding works best on a laptop or desktop, with a keyboard and a wider editor. You can read the problem here and solve it there.

Problem Solving

Input

What You'll Find Here

Practical Challenges Solve coding problems that strengthen your understanding of C.

Step-by-Step Tutorials Learn how to write efficient and optimized code.

Career-Focused Skills Prepare for technical interviews with targeted exercises.

Choose from the following categories