Код: Выделить всё
a) substring length is even b) there exists a character in this substring whose frequency is equal to half the length of substring.Код: Выделить всё
s="idafddfi", output = 13Код: Выделить всё
The valid substrings are: "id", "da", "af", "fd", "df", "fi", "dafd", "afdd", "fddf", "ddfi", "dfii", "idafdd", "dafddf" Код: Выделить всё
1
Подробнее здесь: [url]https://stackoverflow.com/questions/79058356/find-the-number-of-valid-substrings[/url]