7 kyu
Coding 3min : toLoverCase()
162 of 447myjinxin2015
Description:
Task
Yes, your eyes are no problem, this is toLoverCase (), not toLowerCase (), we want to make the world full of love.
What do we need to do?
You need to add a prototype function to the String, the name is toLoverCase. Function can convert the letters in the string, converted to "L", "O", "V", "E", if not the letter, don't change it.
How to convert? :
"love!".toLoverCase()="EVOL!"
"l" is 11th(start with 0) in lower case letters
abcdefghijklmnopqrstuvwxyz
|
0... 11----------------->11th letter
We use this number mod 4------> 11 % 4 = 3
the 3rd(also start with 0) letter of "LOVE" is "E"
LOVE
|
3--------->3rd letter
so convert "l" to "E".
and so on..
"o" convert to "V", "v" convert to "O", "e" convert to "L"
last "!" remain unchanged, because it's not a letter.
more example see the testcases.
Series:
- Bug in Apple
- Father and Son
- Jumping Dutch act
- Planting Trees
- Give me the equation
- Find the murderer
- Reading a Book
- Eat watermelon
- Special factor
- Guess the Hat
- Symmetric Sort
- Are they symmetrical?
- Max Value
- Trypophobia
- Virus in Apple
- Balance Attraction
- Remove screws I
- Remove screws II
- Regular expression compression
- Collatz Array(Split or merge)
- Tidy up the room
- Waiting for a Bus
Puzzles
Games
Similar Kata:
Stats:
Created | Apr 17, 2016 |
Published | Apr 17, 2016 |
Warriors Trained | 984 |
Total Skips | 19 |
Total Code Submissions | 1706 |
Total Times Completed | 447 |
JavaScript Completions | 162 |
Ruby Completions | 50 |
Python Completions | 243 |
Haskell Completions | 31 |
Total Stars | 11 |
% of votes with a positive feedback rating | 87% of 148 |
Total "Very Satisfied" Votes | 117 |
Total "Somewhat Satisfied" Votes | 23 |
Total "Not Satisfied" Votes | 8 |