Rabin-Karp

medium

Rolling the window's hash costs O(1) instead of O(m). Equal hashes are a hint, not a proof - watch a deliberate collision get caught by the verification step.

Average O(n + m)Worst O(n·m)Space O(1)
Loading the rabin-karp engine…

Where to go next