5 kyu
Typoglycemia Generator
240 of 847trip
Description:
Background
There is a message that is circulating via public media that claims a reader can easily read a message where the inner letters of each words is scrambled, as long as the first and last letters remain the same and the word contains all the letters.
Another example shows that it is quite difficult to read the text where all the letters are reversed rather than scrambled.
In this kata we will make a generator that generates text in a similar pattern, but instead of scrambled or reversed, ours will be sorted alphabetically
Requirement
return a string where:
- the first and last characters remain in original place for each word
- characters between the first and last characters must be sorted alphabetically
- punctuation should remain at the same place as it started, for example: shan't -> sahn't
Assumptions
- words are seperated by single spaces
- only spaces separate words, special characters do not, for example: tik-tak -> tai-ktk
- special characters do not take the position of the non special characters, for example: -dcba -> -dbca
- for this kata puctuation is limited to 4 characters: hyphen(-), apostrophe('), comma(,) and period(.)
- ignore capitalisation
for reference: http://en.wikipedia.org/wiki/Typoglycemia
Fundamentals
Similar Kata:
Stats:
Created | Jul 2, 2015 |
Published | Jul 2, 2015 |
Warriors Trained | 2622 |
Total Skips | 532 |
Total Code Submissions | 6048 |
Total Times Completed | 847 |
JavaScript Completions | 240 |
Ruby Completions | 239 |
Python Completions | 394 |
Total Stars | 89 |
% of votes with a positive feedback rating | 94% of 162 |
Total "Very Satisfied" Votes | 146 |
Total "Somewhat Satisfied" Votes | 14 |
Total "Not Satisfied" Votes | 2 |
Total Rank Assessments | 16 |
Average Assessed Rank | 5 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 7 kyu |