6 kyu

Counting Duplicates

95,358 of 245,022kgashok

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 Trained506312
Total Skips62642
Total Code Submissions901642
Total Times Completed245022
Python Completions95358
JavaScript Completions76704
Ruby Completions7402
Haskell Completions1784
C# Completions14857
Elixir Completions560
Shell Completions415
C++ Completions6895
Java Completions21446
Clojure Completions474
R Completions412
Go Completions4115
C Completions2838
Kotlin Completions2303
Scala Completions785
PHP Completions4158
CoffeeScript Completions27
PureScript Completions27
TypeScript Completions4478
Julia Completions113
F# Completions144
Swift Completions1269
Dart Completions1126
Rust Completions2119
NASM Completions30
Crystal Completions28
Racket Completions42
Groovy Completions55
COBOL Completions11
D Completions4
Lua Completions34
Total Stars4659
% of votes with a positive feedback rating90% of 20336
Total "Very Satisfied" Votes16636
Total "Somewhat Satisfied" Votes3354
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
  • trashy_incel 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