PPE2/src/codewars/counting_duplicates.py
2026-02-25 20:06:25 +01:00

15 lines
374 B
Python

# Abgabe - Counting Duplicates Aufgabe von Codewars
# Link dazu: https://www.codewars.com/kata/54bf1c2cd5b56cc47f0007a1
# Leart Ramushi
def duplicate_count(text):
lower_text = text.lower()
letter_set = set()
for i in range(len(lower_text)):
if lower_text.count(lower_text[i]) > 1:
letter_set.add(lower_text[i])
return len(letter_set)