All challenges
Multiple ChoiceHard 30s

KMP Algorithm

The KMP string matching algorithm achieves:
Options
  1. 1O(n+m) time where n=text length, m=pattern length
  2. 2O(m²) time where m=pattern length, ignoring the text
  3. 3O(n) time where n=text length, ignoring pattern length
  4. 4O(n·m) time where n=text length, m=pattern length

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle