Sort Strings by Most Contiguous Vowels
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.
Similar Kata:
Stats:
Created | Jul 15, 2019 |
Published | Jul 18, 2019 |
Warriors Trained | 2997 |
Total Skips | 75 |
Total Code Submissions | 4838 |
Total Times Completed | 1186 |
JavaScript Completions | 740 |
Haskell Completions | 49 |
PHP Completions | 52 |
Shell Completions | 11 |
Clojure Completions | 19 |
Python Completions | 339 |
Julia Completions | 9 |
Total Stars | 56 |
% of votes with a positive feedback rating | 94% of 248 |
Total "Very Satisfied" Votes | 224 |
Total "Somewhat Satisfied" Votes | 17 |
Total "Not Satisfied" Votes | 7 |
Total Rank Assessments | 23 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 8 kyu |