CodingReported in a candidate post, Sep 2021
Count occurrences of a substring in a string
Filed under Verizon
The question
Count how many times a pattern occurs in a string, including overlapping matches (e.g. aa in aaaaa gives 4).
No write-up yet. Related questions below have one.
Related Verizon questions
Collected from public candidate posts and coding forums. Updated Nov 2026.