Abgabe Aufgabe 1 Codewars fix

This commit is contained in:
leart-ramushi 2026-02-25 20:06:25 +01:00
parent c920aa84e9
commit 0a4b81b1cb

View File

@ -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)