diff --git a/src/codewars/counting_duplicates.py b/src/codewars/counting_duplicates.py new file mode 100644 index 0000000..d44ffca --- /dev/null +++ b/src/codewars/counting_duplicates.py @@ -0,0 +1,14 @@ +# 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)