6 kyu

Counting Duplicates

21,568 of 246,643kgashok

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 Trained508957
Total Skips62810
Total Code Submissions905637
Total Times Completed246643
Python Completions96083
JavaScript Completions77131
Ruby Completions7419
Haskell Completions1791
C# Completions14938
Elixir Completions560
Shell Completions417
C++ Completions6961
Java Completions21568
Clojure Completions474
R Completions413
Go Completions4158
C Completions2862
Kotlin Completions2316
Scala Completions786
PHP Completions4180
CoffeeScript Completions27
PureScript Completions27
TypeScript Completions4531
Julia Completions113
F# Completions144
Swift Completions1273
Dart Completions1144
Rust Completions2143
NASM Completions31
Crystal Completions28
Racket Completions43
Groovy Completions55
COBOL Completions11
D Completions4
Lua Completions37
Total Stars4685
% of votes with a positive feedback rating90% of 20379
Total "Very Satisfied" Votes16675
Total "Somewhat Satisfied" Votes3357
Total "Not Satisfied" Votes347
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