6 kyu
The Vowel Code
9,093 of 21,731yaphi1
Description:
Step 1: Create a function called encode()
to replace all the lowercase vowels in a given string with numbers according to the following pattern:
a -> 1
e -> 2
i -> 3
o -> 4
u -> 5
For example, encode("hello")
would return "h2ll4"
. There is no need to worry about uppercase vowels in this kata.
Step 2: Now create a function called decode()
to turn the numbers back into vowels according to the same pattern shown above.
For example, decode("h3 th2r2")
would return "hi there"
.
For the sake of simplicity, you can assume that any numbers passed into the function will correspond to vowels.
Arrays
Strings
Regular Expressions
Fundamentals
Similar Kata:
Stats:
Created | May 7, 2014 |
Published | May 7, 2014 |
Warriors Trained | 31140 |
Total Skips | 2487 |
Total Code Submissions | 55059 |
Total Times Completed | 21731 |
JavaScript Completions | 9093 |
Python Completions | 9296 |
Ruby Completions | 571 |
C Completions | 657 |
C++ Completions | 2057 |
NASM Completions | 32 |
TypeScript Completions | 312 |
Groovy Completions | 13 |
Shell Completions | 41 |
Total Stars | 441 |
% of votes with a positive feedback rating | 93% of 2187 |
Total "Very Satisfied" Votes | 1888 |
Total "Somewhat Satisfied" Votes | 270 |
Total "Not Satisfied" Votes | 29 |