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:||ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.3.2, CPP 6.3, CPP14, CS2, D, ERL, FORT, FS, GO, HASK, ICK, ICON, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, NODEJS, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYPY, PYTH, PYTH 3.5, RUBY, SCALA, SCM chicken, SCM guile, SCM qobi, ST, TCL, TEXT, WSPC|
Fetching successful submissions
If you are still having problems, see a sample solution here.