### 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`

Source: codewars | Difficulty: EASY
Tags: String algorithms

Fundamentals

Starter code: def duplicate_count(text):
	

Solutions:
def duplicate_count(s):
	return len([c for c in set(s.lower()) if s.lower().count(c) > 1])


def duplicate_count(text):
	count = 0
	counted = []
	test = list(text.lower())
	for (i, c) in enumerate(test):
		if test.count(test[i]) >= 2 and counted.count(test[i]) == 0:
			count += 1
			counted.append(test[i])
			test.remove(test[i])
	return count


def duplicate_count(text):
	seen = set()
	dupes = set()
	for char in text:
		char = char.lower()
		if char in seen:
			dupes.add(char)
		seen.add(char)
	return len(dupes)


from collections import Counter

def duplicate_count(text):
	return sum((1 for (c, n) in Counter(text.lower()).items() if n > 1))


def duplicate_count(text):
	count = 0
	for c in set(text.lower()):
		if text.lower().count(c) > 1:
			count += 1
	return count


from collections import Counter

def duplicate_count(text):
	counter = Counter(text.lower())
	return len([list(counter.keys()) for i in list(counter.values()) if i > 1])


def duplicate_count(text):
	text = text.lower()
	duplicates = []
	for i in text:
		if text.count(i) > 1 and i not in duplicates:
			duplicates.append(i)
	return len(duplicates)


def duplicate_count(text):
	text = text.lower()
	return sum([text.count(c) > 1 for c in set(text)])


from collections import Counter

def duplicate_count(text):
	return sum((v > 1 for v in Counter(text.lower()).values()))


def duplicate_count(text):
	n = 0
	text = text.lower()
	for i in set(text):
		if text.count(i) > 1:
			n += 1
	return n


from re import findall

def duplicate_count(text):
	return len(findall('(\\w)\\1+', ''.join(sorted(text.upper()))))