6 kyu

Counting Duplicates

94,369 of 242,879kgashok

Description:

Count the number of Duplicates

Write a function that will return the count of distinct case-insensitive alphabetic characters and numeric digits that occur more than once in the input string. The input string can be assumed to contain only alphabets (both uppercase and lowercase) and numeric digits.

Example

"abcde" -> 0 # no characters repeats more than once
"aabbcde" -> 2 # 'a' and 'b'
"aabBcde" -> 2 # 'a' occurs twice and 'b' twice (`b` and `B`)
"indivisibility" -> 1 # 'i' occurs six times
"Indivisibilities" -> 2 # 'i' occurs seven times and 's' occurs twice
"aA11" -> 2 # 'a' and '1'
"ABBA" -> 2 # 'A' and 'B' each occur twice

Strings
Fundamentals

Stats:

CreatedJan 21, 2015
PublishedJan 21, 2015
Warriors Trained502844
Total Skips62416
Total Code Submissions896365
Total Times Completed242879
Python Completions94369
JavaScript Completions76136
Ruby Completions7386
Haskell Completions1778
C# Completions14746
Elixir Completions560
Shell Completions409
C++ Completions6806
Java Completions21279
Clojure Completions473
R Completions408
Go Completions4062
C Completions2809
Kotlin Completions2285
Scala Completions784
PHP Completions4129
CoffeeScript Completions27
PureScript Completions27
TypeScript Completions4420
Julia Completions113
F# Completions143
Swift Completions1263
Dart Completions1104
Rust Completions2097
NASM Completions28
Crystal Completions28
Racket Completions41
Groovy Completions55
COBOL Completions10
D Completions4
Lua Completions30
Total Stars4637
% of votes with a positive feedback rating90% of 20271
Total "Very Satisfied" Votes16580
Total "Somewhat Satisfied" Votes3345
Total "Not Satisfied" Votes346
Ad
Contributors
  • kgashok Avatar
  • jhoffner Avatar
  • user9396321 Avatar
  • ZozoFouchtra Avatar
  • bkaes Avatar
  • GiacomoSorbi Avatar
  • suic Avatar
  • brunolm Avatar
  • justlearning Avatar
  • Chrono79 Avatar
  • imjasonmiller Avatar
  • ryanwinchester Avatar
  • jbristow Avatar
  • Voile Avatar
  • YiFenZ Avatar
  • neilm Avatar
  • qweewq Avatar
  • kiljaden Avatar
  • rowcased Avatar
  • mentalplex Avatar
  • monadius Avatar
  • phanttro Avatar
  • hobovsky Avatar
  • xavierguihot Avatar
  • stellartux Avatar
  • akvptp Avatar
  • SunMaster Avatar
  • user8436785 Avatar
  • DjLogozzo Avatar
  • vvaannaa1 Avatar
  • eonil Avatar
  • ejini战神 Avatar
  • davidies Avatar
  • akar-0 Avatar
  • antonkesy Avatar
  • o2001 Avatar
  • KayleighWasTaken Avatar
  • metatable Avatar
Ad