Skip to main content

Practice · 3 of 3

Overlapping Matches

CHALLENGE
Difficulty: advanced+25 XP

**Problem.** Lines of: p t. Print, per line, the number of OVERLAPPING occurrences of p in t. **Constraints:** up to 200 lines; 1 ≤ |p| ≤ 5; 1 ≤ |t| ≤ 1000. Z on p + '#' + t; count every position with z[i] >= |p|.

Back to lesson: Practice: String Trio