Skip to content

Instantly share code, notes, and snippets.

View hendrixthecoder's full-sized avatar
🏠
Working from home

Johnbull Biobele Glad hendrixthecoder

🏠
Working from home
View GitHub Profile
@hendrixthecoder
hendrixthecoder / index.js
Last active April 21, 2025 08:56
Solution for problem "Given an array of words, group them by word length, then sort within each group based on the number of vowels in the word (descending), and finally, for ties, use alphabetical order (case-insensitive)"
const wordGroup = [
"apple", "orange", "pear", "grape",
"kiwi", "Avocado", "banana", "fig", "Apricot"
];
const getVowelCount = (str) => {
const vowels = ["a", "e", "i", "o", "u"];
let vowelCount = 0;
for(let i = 0; i < str.length; i++){