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 (bandB)
"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
'매일매일개발 > Codewars' 카테고리의 다른 글
codewars #75 Numericals of a String (6kyu) (0) | 2018.07.09 |
---|---|
codewars #74 CamelCase to underscore(6kyu) (0) | 2018.07.06 |
codewars #72 Moving Zeros To The End (5kyu) (0) | 2018.07.04 |
codewars #71 Triple trouble (6kyu) (0) | 2018.07.03 |
codewars #70 IQ Test (6kyu) (0) | 2018.07.02 |