CT374

The Pattern Count Beneath Brineport

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

At the smokehouses of Brineport, Nyssa records each charms in a worn leather ledger. The guild wants answers, not guesses. Task: Count how many times string t occurs inside s (occurrences may overlap). Input format: Two lines: string s, then pattern t. Output format: Print the occurrence count. Constraints: 1 <= |t| <= |s| <= 86; lowercase letters.

Example 1:

Input: ueqrxtfvughzozhpltwmeohdxbwpevannttmpwxrsdsuhxqhza btao
Output: 0

Example 2:

Input: th m
Output: 0

Example 3:

Input: zxqajhujjobnokndftegzkwzhvvlauls a
Output: 2

Constraints:

1 <= |t| <= |s| <= 86; lowercase letters.

Loading...
Test Cases:No test cases
No test cases available.