| about | help | code help+videos | done | prefs |
Given a string, calculate and return a sum where each vowel has the following value: a=1, e=2, i=3, o=4, u=5. Capital vowels are worth double. Examples: "Hello" has an e worth 2, and an o worth 4 for a total value of 2+4=6. "Nyx" has no vowels so it has a value of 0. "Aaron" has a capital A worth 2, and a lowercase a worth 1, and an o worth 4 for a total value of 2+1+4=7. vowelSum("Hello") → 6 vowelSum("Nyx") → 0 vowelSum("Aaron") → 7 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 250 Post-solution available
Copyright Nick Parlante 2017 - privacy