Home
Strings
Pattern Matching
String Search
String Search
Medium
Code & Problem
Visualizer
Problem Statement
Find all occurrences of a pattern string within a text string using naive string matching algorithm.
Constraints
Case sensitive matching
Time Complexity: O(N × M)
Space Complexity: O(1)
N = length of text, M = length of pattern
Solution
Run & Visualize
Run