Draft
Abbreviatize This!
77 of 122Cryptacular
Description:
Globalization, Internationalization, Localization, Translation... These terms are just too long to write more than once!
Many people have felt the same way and have therefore started to abbreviate terms like this:
- Globalization => G11n
- Internationalization => I18n
- Localization => L10n
- Translation => T9n
You might notice the pattern: [first letter] + [number of letters in between the first and last letter] + [last letter]
.
G l o b a l i z a t i o n
G [1 2 3 4 5 6 7 8 9 10 11] n
G11n
We want to create a function Abbreviatize
that takes a single parameter of type string
, which returns the abbreviated form of the input string.
Keep in mind that we want to make a shorter version of the word, so if the word is The
, there's no point in abbreviating it to T1e
. In that case, we just want to return the word that was passed in.
Some examples:
Abbreviatize("Globalization") => "G11n"
Abbreviatize("Scherpenhuizen") => "S12n"
Abbreviatize("Four") => "F2r"
Abbreviatize("The") => "The"
Abbreviatize("A") => "A"
Strings
Stats:
Created | Mar 21, 2018 |
Warriors Trained | 171 |
Total Skips | 10 |
Total Code Submissions | 384 |
Total Times Completed | 122 |
JavaScript Completions | 77 |
Go Completions | 46 |
Total Stars | 0 |
% of votes with a positive feedback rating | 79% of 70 |
Total "Very Satisfied" Votes | 47 |
Total "Somewhat Satisfied" Votes | 17 |
Total "Not Satisfied" Votes | 6 |
Total Rank Assessments | 69 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |