CT495

The Pattern Count of the Verdant scrolls

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Deep in the lantern reef of Glowtide, Cora studies rows of scrolls entries. One clean number will settle the guild's oldest argument. 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| <= 178; lowercase letters.

Example 1:

Input: nbifvynhtnqmahkwejahhadchbobkhdinamrpmhdzsvrelvsnsgqpupxacaphlamxfchrjefboeggeiljndtuawzhwabmihhavlbxmuz chbo
Output: 1

Example 2:

Input: czeuhxjbpllgadzedghwcxjataxmluxedagnkavnmddwrgueydsu uo
Output: 0

Example 3:

Input: tbawusygbkmvaggmkrimnbnbkunnftangunjdqjakrmaiareapuoztmjfzftvtxuprrddcgvuzcieqsqagzfeleeacdzrtaqkfcqunh mvagg
Output: 1

Constraints:

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

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