Double X Counter
Finding short fragments inside a string is useful in text checks, logs, and simple analyzers. Write a function count_xx that takes a string s and counts how many times the substring xx appears in it. Overlapping matches count too, so xxx contains two such pairs.
Примеры
Ввод
"abcxx"Вывод
1Ввод
"xxx"Вывод
2Ввод
"xxxx"Вывод
3Нужно реализовать
def count_xx(s: str) -> int:
Теги
stringssliding-window
Accedi per vedere la cronologia degli invii
AccediAccedi per usare l'AI Mentor
AccediTests12
Visible tests
Test nascosto 7
Test nascosto 8
Test nascosto 9
Test nascosto 10
Test nascosto 11
Test nascosto 12
They run when you press "Submit" — your whole solution is checked against them so you can't hard-code answers for the visible cases.
Focus radio
Paused · SomaFM · Fluid