7 kyu
The Speed of Letters
251 of 979Yilian
Description:
Given a string as input, return a new string with each letter pushed to the right by its respective index in the alphabet.
We all know that A
is a slow and Z
is a fast letter. This means that Z
gets shifted to the right by 25 spaces, A
doesn't get shifted at all, and B
gets shifted by 1 space.
You can assume the following things about your input:
- It will only contain uppercase letters from
A
toZ
, no whitespaces or punctuation; - Input strings will not exceed 100 characters (although your output string might!)
Note that if 2 or more letters fall onto the same space after shifting, the latest character will be used. For example: "BA" -> " A"
Examples
"AZ" --> "A Z"
"ABC" --> "A B C"
"ACE" --> "A C E"
"CBA" --> " A"
"HELLOWORLD" --> " E H DLL OLO R W"
Algorithms
Similar Kata:
Stats:
Created | Dec 2, 2020 |
Published | Dec 2, 2020 |
Warriors Trained | 2776 |
Total Skips | 50 |
Total Code Submissions | 4161 |
Total Times Completed | 979 |
JavaScript Completions | 251 |
C# Completions | 87 |
Python Completions | 333 |
Ruby Completions | 33 |
Java Completions | 150 |
C++ Completions | 101 |
C Completions | 62 |
Perl Completions | 36 |
Haskell Completions | 8 |
Total Stars | 55 |
% of votes with a positive feedback rating | 89% of 233 |
Total "Very Satisfied" Votes | 194 |
Total "Somewhat Satisfied" Votes | 29 |
Total "Not Satisfied" Votes | 10 |
Total Rank Assessments | 32 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |