6 kyu
Case Reversal of Consecutive Duplicates
391 of 734glenoakes
Description:
The aim of this Kata is to write a function which will reverse the case of all consecutive duplicate letters in a string. That is, any letters that occur one after the other and are identical.
If the duplicate letters are lowercase then they must be set to uppercase, and if they are uppercase then they need to be changed to lowercase.
Examples:
reverseCase("puzzles") Expected Result: "puZZles"
reverseCase("massive") Expected Result: "maSSive"
reverseCase("LITTLE") Expected Result: "LIttLE"
reverseCase("shhh") Expected Result: "sHHH"
Arguments passed will include only alphabetical letters A–Z or a–z.
Fundamentals
Similar Kata:
Stats:
Created | Jul 5, 2016 |
Published | Aug 3, 2016 |
Warriors Trained | 1308 |
Total Skips | 69 |
Total Code Submissions | 3096 |
Total Times Completed | 734 |
JavaScript Completions | 391 |
Python Completions | 291 |
Ruby Completions | 84 |
Crystal Completions | 7 |
Total Stars | 29 |
% of votes with a positive feedback rating | 93% of 226 |
Total "Very Satisfied" Votes | 197 |
Total "Somewhat Satisfied" Votes | 27 |
Total "Not Satisfied" Votes | 2 |
Total Rank Assessments | 11 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 7 kyu |