aufgabe1_codewars #2
14
src/codewars/counting_duplicates.py
Normal file
14
src/codewars/counting_duplicates.py
Normal 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)
|
||||
Loading…
x
Reference in New Issue
Block a user