Counting Duplicates
16 февраля 2025 г.Senior Frontend

Counting Duplicates
Напишите функцию, которая будет возвращать количество символов, встречающихся во входной строке более одного раза без учета регистра. Предполагается, что входная строка содержит только прописные и строчные буквы, а также цифры.
Пример:
"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