7 kyu
Fix string case
11,477 of 33,052KenKamau
Description:
In this Kata, you will be given a string that may have mixed uppercase and lowercase letters and your task is to convert that string to either lowercase only or uppercase only based on:
- make as few changes as possible.
- if the string contains equal number of uppercase and lowercase letters, convert the string to lowercase.
For example:
solve("coDe") = "code". Lowercase characters > uppercase. Change only the "D" to lowercase.
solve("CODe") = "CODE". Uppercase characters > lowecase. Change only the "e" to uppercase.
solve("coDE") = "code". Upper == lowercase. Change all to lowercase.
More examples in test cases. Good luck!
Please also try:
Fundamentals
Similar Kata:
Stats:
Created | Jun 6, 2018 |
Published | Jun 7, 2018 |
Warriors Trained | 46767 |
Total Skips | 4181 |
Total Code Submissions | 76883 |
Total Times Completed | 33052 |
JavaScript Completions | 11477 |
Haskell Completions | 257 |
Python Completions | 9832 |
Ruby Completions | 674 |
Crystal Completions | 18 |
C++ Completions | 1430 |
C# Completions | 1493 |
PHP Completions | 902 |
NASM Completions | 27 |
C Completions | 518 |
Java Completions | 3131 |
CoffeeScript Completions | 16 |
Dart Completions | 729 |
CoffeeScript Completions | 0 |
TypeScript Completions | 710 |
Go Completions | 1161 |
Elixir Completions | 120 |
Kotlin Completions | 1003 |
Clojure Completions | 81 |
Rust Completions | 429 |
COBOL Completions | 15 |
Total Stars | 307 |
% of votes with a positive feedback rating | 94% of 3262 |
Total "Very Satisfied" Votes | 2871 |
Total "Somewhat Satisfied" Votes | 365 |
Total "Not Satisfied" Votes | 26 |
Total Rank Assessments | 19 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |