6 kyu

Sort Strings by Most Contiguous Vowels

740 of 1,186jlb071

Description:

The goal of this Kata is to write a function that will receive an array of strings as its single argument, then the strings are each processed and sorted (in desending order) based on the length of the single longest sub-string of contiguous vowels ( aeiouAEIOU ) that may be contained within the string. The strings may contain letters, numbers, special characters, uppercase, lowercase, whitespace, and there may be (often will be) multiple sub-strings of contiguous vowels. We are only interested in the single longest sub-string of vowels within each string, in the input array.

Example:

str1 = "what a beautiful day today"
str2 = "it's okay, but very breezy"

When the strings are sorted, str1 will be first as its longest sub-string of contiguous vowels "eau" is of length 3, while str2 has as its longest sub-string of contiguous vowels "ee", which is of length 2.

If two or more strings in the array have maximum sub-strings of the same length, then the strings should remain in the order in which they were found in the orginal array.

Fundamentals
Strings
Sorting

Stats:

CreatedJul 15, 2019
PublishedJul 18, 2019
Warriors Trained2997
Total Skips75
Total Code Submissions4838
Total Times Completed1186
JavaScript Completions740
Haskell Completions49
PHP Completions52
Shell Completions11
Clojure Completions19
Python Completions339
Julia Completions9
Total Stars56
% of votes with a positive feedback rating94% of 248
Total "Very Satisfied" Votes224
Total "Somewhat Satisfied" Votes17
Total "Not Satisfied" Votes7
Total Rank Assessments23
Average Assessed Rank
6 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • jlb071 Avatar
  • JohanWiltink Avatar
  • user9644768 Avatar
  • ploppity Avatar
  • stellartux Avatar
  • albertogcmr Avatar
Ad