Find the count
All submissions for this problem are available.
Sherlock Needs Your Help. He has two strings A and B.He needs your help to find the number of occurrences of string B in string A because Moriarty is strangling him.
- The first line of the input contains an integer T denoting the number strings.
- The first line of each test case contains a single string S. The second line contains substring w, which you need to find!!
- For each test case, output a single line containing the number of times the substring occurs in the string. If it doesn't occur, print "Substring not Found"
- 1 ≤ T ≤ 1000
- 1 ≤ S ≤ 100000
Input: 2 hackercupcupcode cup ababacabaa aba Output: 2 3
Example case 1. just like above find the substring and write the code!!
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, PYP3, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.