CT23357

Rosa and the Jasper charms

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Rosa found an old ledger of charms in the observatory attic at the lantern lake of Firefly Mere. The margin notes pose a precise question. 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| <= 758; lowercase letters.

Example 1:

Input: xnrhpmbewoapsfhgghjlbswhnhtcwcvlxjcxusxmooxafrcorpvjizkfwpmptipryefuhvfdzhpubqzobazle weub
Output: 0

Example 2:

Input: exrozyiwaaadeuaudpvaskjoqriefunrwapvhhypjrcdwuybccghptmsfudnsjuycfhktqznrskaacickkshsdjsluabedgfiaecjahkktoafxskpktlkkgxgaeociagdpwwduidkwfabhcstvnirwtorstavsfcwuapvirgogoczmewhrzoiqeuxglftfuipeyklnteaehekndfcqzwlknjlaserxqzmtzzpdxmjpsaqeozexowiukjiqgiizzloaiiocxvemiynipbdyhpcrazjohqldkjaqfubizwhpyydovaqpaaklvipbpwybhhhqbtgdiaiwrqhvirsrrfrjwvmqutrfxelqrldjeutcsrdkyiprarfejpwisgixgnqrebommabsyntotmbgzzqnhwrkrxlfaitanmmgkragabjwxlqsowpgnujunsntdnochgtuojecgcxxomimqyscgzupudemraotmqgtvclstvwagjdiokpiiqcsrmfxpdnfypuznoxbjgxeq y
Output: 14

Example 3:

Input: ciyzjrdadheiqnhnghyjrihgndkvowqoyojkknerdepncahpksmpbknzutdemskrfkgfvlhfbtcdafuzbmfrzestpsmgeztacawjiekacqbfermipilmebmhynlbffuxhjsayseskdknaafbfxyylubkpzlbssuaegbqerlujfryyoelnprndlszufyxrclzepzjtqhbvkhuthpcwlnwqikibsiillakayeqlkeobvalszbnylcajcoddzkdlvsjlpkelsafhjuprucxvgnsjupsszlvftdbkauazwymppxvfviyzrcuttndhwahhvrrpvlbfezzesgqohkdihlrzuxbmpbvknhykapfttoengubkarxcdthcqoitxrfpnpldooeacbpwawxbpkxbvf sqbs
Output: 0

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Rosa and the Jasper charms - EASY Coding Problem | CodeTikki