6 kyu

Case Reversal of Consecutive Duplicates

471 of 910glenoakes

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:

"puzzles" --> "puZZles"
"massive" --> "maSSive"
"LITTLE"  --> "LIttLE"
"shhh"    --> "sHHH"

Arguments passed will include only alphabetical letters A–Z or a–z.

Fundamentals

More By Author:

Check out these other kata created by glenoakes

Stats:

CreatedJul 5, 2016
PublishedAug 3, 2016
Warriors Trained1681
Total Skips75
Total Code Submissions3803
Total Times Completed910
JavaScript Completions471
Python Completions384
Ruby Completions91
Crystal Completions8
Total Stars38
% of votes with a positive feedback rating93% of 243
Total "Very Satisfied" Votes212
Total "Somewhat Satisfied" Votes29
Total "Not Satisfied" Votes2
Total Rank Assessments11
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • glenoakes Avatar
  • GiacomoSorbi Avatar
  • smile67 Avatar
  • adrian.eyre Avatar
  • Just4FunCoder Avatar
  • saudiGuy Avatar
Ad