6 kyu

String character frequency

24 of 763KenKamau

Description:

In this Kata, we are going to determine if the count of each of the characters in a string can be equal if we remove a single character from that string.

For example:

solve('abba') = false -- if we remove any character, the count of each character will not be equal.
solve('abbba') = true -- if we remove one b, the count of each character becomes 2.
solve('aaaa') = true -- if we remove one character, the remaining characters have same count.
solve('wwwf') = true -- if we remove f, the remaining letters have same count.

More examples in the test cases. Empty string is not tested.

Good luck!

Strings
Algorithms

Stats:

CreatedNov 26, 2017
PublishedDec 2, 2017
Warriors Trained2302
Total Skips60
Total Code Submissions9515
Total Times Completed763
JavaScript Completions287
Python Completions423
Ruby Completions58
Haskell Completions24
Total Stars84
% of votes with a positive feedback rating92% of 229
Total "Very Satisfied" Votes195
Total "Somewhat Satisfied" Votes30
Total "Not Satisfied" Votes4
Total Rank Assessments3
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • KenKamau Avatar
  • Blind4Basics Avatar
  • solitude Avatar
  • saudiGuy Avatar
Ad