Ladataan tehtävää…
In low-level work, a file is often treated as a simple list of bytes. Given buffer and pattern, count how many times pattern appears in buffer as a contiguous fragment. Matches may overlap, so after finding one match you cannot simply jump past it. If the pattern is not found, return 0.
[255, 20, 133, 1, 255, 20, 133], [255, 20, 133]2[0, 0, 0, 0], [0, 0]3[1, 2, 3], [4]0def memmem_count(buffer, pattern):
Kirjaudu sisään nähdäksesi palautushistorian
Kirjaudu sisäänKirjaudu sisään käyttääksesi tekoälymentoria
Kirjaudu sisäänThey run when you press "Submit" — your whole solution is checked against them so you can't hard-code answers for the visible cases.