diff --git a/Find a string.py b/Find a string.py index 3cd314c..58e3c11 100644 --- a/Find a string.py +++ b/Find a string.py @@ -1,13 +1,11 @@ -# Enter your code here. Read input from STDIN. Print output to STDOUT -# Author : Vineet -s1 = str(raw_input()) -s2 = str(raw_input()) +s1 = str(input()) +s2 = str(input()) -# print s1.count(s2) -- for non-overlapping sequences -# Below is code for overlapping sequences -cnt = 0 + +t = 0 for i in range(len(s1)): if s1[i:].startswith(s2): - cnt += 1 - #i += x -print cnt \ No newline at end of file + t=t+1 + + +print(t)