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:

Simple time difference

Simple remove duplicates

Fundamentals

Stats:

CreatedJun 6, 2018
PublishedJun 7, 2018
Warriors Trained46767
Total Skips4181
Total Code Submissions76883
Total Times Completed33052
JavaScript Completions11477
Haskell Completions257
Python Completions9832
Ruby Completions674
Crystal Completions18
C++ Completions1430
C# Completions1493
PHP Completions902
NASM Completions27
C Completions518
Java Completions3131
CoffeeScript Completions16
Dart Completions729
CoffeeScript Completions0
TypeScript Completions710
Go Completions1161
Elixir Completions120
Kotlin Completions1003
Clojure Completions81
Rust Completions429
COBOL Completions15
Total Stars307
% of votes with a positive feedback rating94% of 3262
Total "Very Satisfied" Votes2871
Total "Somewhat Satisfied" Votes365
Total "Not Satisfied" Votes26
Total Rank Assessments19
Average Assessed Rank
7 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • KenKamau Avatar
  • GiacomoSorbi Avatar
  • imjasonmiller Avatar
  • kazk Avatar
  • adrian.eyre Avatar
  • Blind4Basics Avatar
  • realfg Avatar
  • Souzooka Avatar
  • rowcased Avatar
  • rsa Avatar
  • clcraig Avatar
  • FArekkusu Avatar
  • monadius Avatar
  • hobovsky Avatar
  • Zordid Avatar
  • rabbit_binary7 Avatar
  • user8436785 Avatar
  • DVYKPABQDG Avatar
  • akar-0 Avatar
  • yLaWy Avatar
Ad