Medium

String Matching

The direct algorithm tries the pattern at every position in the text and compares characters until one fails.

Costs

CategoryAlgorithm
DifficultyMedium
TimeO(n × m)
n and mtext length and pattern length
Faster methodsKMP and Rabin-Karp

Questions

What is String Matching?

The direct algorithm tries the pattern at every position in the text and compares characters until one fails.

Where do I practice it?

DSA Master keeps challenges and progress on the phone. This page is the idea and the costs.