You are viewing a single comment's thread. Return to all comments →
def count_substring(string, sub_string): count = 0 found = string.find(sub_string) while found != -1: count += 1 found = string.find(sub_string, found + 1) return count
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Find a string
You are viewing a single comment's thread. Return to all comments →