6 kyu

Counting Duplicates

76,291 of 243,492kgashok

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 Trained503882
Total Skips62477
Total Code Submissions897938
Total Times Completed243492
Python Completions94647
JavaScript Completions76291
Ruby Completions7392
Haskell Completions1780
C# Completions14784
Elixir Completions560
Shell Completions411
C++ Completions6835
Java Completions21321
Clojure Completions473
R Completions410
Go Completions4080
C Completions2817
Kotlin Completions2292
Scala Completions784
PHP Completions4136
CoffeeScript Completions27
PureScript Completions27
TypeScript Completions4437
Julia Completions113
F# Completions144
Swift Completions1266
Dart Completions1107
Rust Completions2103
NASM Completions28
Crystal Completions28
Racket Completions41
Groovy Completions55
COBOL Completions10
D Completions4
Lua Completions32
Total Stars4643
% of votes with a positive feedback rating90% of 20285
Total "Very Satisfied" Votes16593
Total "Somewhat Satisfied" Votes3346
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