6 kyu

Consonant value

5,964 of 19,422KenKamau

Description:

Given a lowercase string that has alphabetic characters only and no spaces, return the highest value of consonant substrings. Consonants are any letters of the alphabet except "aeiou".

We shall assign the following values: a = 1, b = 2, c = 3, .... z = 26.

For example, for the word "zodiacs", let's cross out the vowels. We get: "z o d ia c"

"zodiac" -> 26

The consonant substrings are: "z", "d" and "c" with values "z" = 26, "d" = 4 and "c" = 3. The highest is 26.

"strength" -> 57

The consonant substrings are: "str" and "ngth" with values "str" = 19 + 20 + 18 = 57 and "ngth" = 14 + 7 + 20 + 8 = 49. The highest is 57.

For C: do not mutate input.

More examples in test cases. Good luck!

If you like this Kata, please try:

Word values

Vowel-consonant lexicon

Strings
Fundamentals

Stats:

CreatedSep 23, 2017
PublishedSep 25, 2017
Warriors Trained36089
Total Skips6427
Total Code Submissions76215
Total Times Completed19422
JavaScript Completions5964
Python Completions6320
Ruby Completions565
Haskell Completions228
C# Completions1019
C Completions664
NASM Completions31
CoffeeScript Completions15
Crystal Completions22
PHP Completions464
TypeScript Completions728
Go Completions695
Dart Completions487
C++ Completions1042
Java Completions1639
Elixir Completions80
Groovy Completions7
Total Stars534
% of votes with a positive feedback rating94% of 2272
Total "Very Satisfied" Votes2016
Total "Somewhat Satisfied" Votes231
Total "Not Satisfied" Votes25
Total Rank Assessments11
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • KenKamau Avatar
  • anter69 Avatar
  • Chrono79 Avatar
  • docgunthrop Avatar
  • Blind4Basics Avatar
  • Voile Avatar
  • realfg Avatar
  • rowcased Avatar
  • clcraig Avatar
  • monadius Avatar
  • hobovsky Avatar
  • uniapi Avatar
  • rabbit_binary7 Avatar
  • user8436785 Avatar
  • ejini战神 Avatar
  • avermakov Avatar
  • FranzMartyn Avatar
  • KayleighWasTaken Avatar
  • saudiGuy Avatar
Ad