Notiek uzdevuma ielāde…
Sometimes you need to find not just one character, but a short repeated fragment inside a string. 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: the string xxx contains two such fragments.
"abcxx"1"xxx"2"xxxx"3def count_xx(s: str) -> int:
Pieslēdzies, lai redzētu iesniegumu vēsturi
PieslēgtiesPieslēdzies, lai izmantotu AI mentoru
Pieslēgties"abcxx"1"xxx"2"xxxx"3"abc"0"Hello there"0"xx"1