CT778

Envoy's Lazy Ledger

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Legend says the vault under the mulberry rows of Silkmead opens only for a perfect tally of banners. Envoy means to find out. 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| <= 134; lowercase letters.

Example 1:

Input: ypnafetevhghgjcmbqsijdqxscpavmtrghfgqngbmyukhrseqtniazxysxdffmpjhbxsdvtsndlrgztqgddysvdruiywvomsihbkipcubhrrjayedd si
Output: 2

Example 2:

Input: cyjgpzavgsohzuoblddeckbuftmkbsxcirpjmwarprfilakzhlxautdstanqqwqrshbowprsmeawkeonzkephxsyaunyebfbovewiscobrufbnflukeweuzcmxedk pecj
Output: 0

Example 3:

Input: dlvgirgfqqxfklcvhnhunvvzbptjpeydwzfgrkxzqxpoesvckzqjfevfruyauochrxgjtzpkacqcycgiartt x
Output: 4

Constraints:

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

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