We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5609b37 commit 5041d10Copy full SHA for 5041d10
Hackerrank Solutions/python/Find a string.py
@@ -0,0 +1,10 @@
1
+# Problem: https://www.hackerrank.com/challenges/find-a-string/problem
2
+# Score: 10
3
+
4
5
+def count_substring(string, sub_string):
6
+ count = 0
7
+ for i in range(len(string) - len(sub_string) + 1):
8
+ if string[i: i + len(sub_string)] == sub_string:
9
+ count += 1
10
+ return count
0 commit comments