Duplicate Character Counter in Every Language

Published on 11 October 2020 (Updated: 14 May 2022)

Duplicate Character Counter in Every Language

Welcome to the Duplicate Character Counter page! Here, you'll find a description of the project as well as a list of sample programs written in various languages.


Although a one line solution for this problem is feasible, just as huge brute force solutions are, we should avoid both of these approaches. Instead, our goal should be to find a fine line between both, where the code is not bogged down but is largely readable and maintainable.


The code should return the count of all duplicate, case-insensitive, alphanumeric characters, that occur more than once in the given string. Characters should also be presented in the order in which they appear in the string. For instance, 'abba' should output 'a' as the firstcharacter that has a duplicate.


Description Input Output
Basic String "goodbyeblues" o: 2
b: 2
e: 2
Correct Order "abba" a: 2
b: 2
Case Distinct "aAbB" No duplicate characters