7 kyu

Character Counter

419 of 6,654Shivo

Description:

You are going to be given a word. Your job will be to make sure that each character in that word has the exact same number of occurrences. You will return true if it is valid, or false if it is not.

For this kata, capitals are considered the same as lowercase letters. Therefore: "A" == "a"

The input is a string (with no spaces) containing [a-z],[A-Z],[0-9] and common symbols. The length will be 0 < length < 100.

Examples

  • "abcabc" is a valid word because "a" appears twice, "b" appears twice, and"c" appears twice.
  • "abcabcd" is NOT a valid word because "a" appears twice, "b" appears twice, "c" appears twice, but "d" only appears once!
  • "123abc!" is a valid word because all of the characters only appear once in the word.
Strings
Algorithms

More By Author:

Check out these other kata created by Shivo

Stats:

CreatedDec 21, 2015
PublishedDec 22, 2015
Warriors Trained11694
Total Skips439
Total Code Submissions23307
Total Times Completed6654
C# Completions419
JavaScript Completions2191
CoffeeScript Completions21
Python Completions2247
Ruby Completions549
Java Completions1189
Clojure Completions81
Haskell Completions119
C Completions88
COBOL Completions9
Total Stars155
% of votes with a positive feedback rating92% of 951
Total "Very Satisfied" Votes828
Total "Somewhat Satisfied" Votes99
Total "Not Satisfied" Votes24
Ad
Contributors
  • Shivo Avatar
  • g964 Avatar
  • GiacomoSorbi Avatar
  • anter69 Avatar
  • alessandrodalbello Avatar
  • Blind4Basics Avatar
  • monadius Avatar
  • hobovsky Avatar
  • solitude Avatar
  • trashy_incel Avatar
  • akar-0 Avatar
  • sid114 Avatar
Ad