Back Clear
# Your Problem: # Given a string and a non-empty substring sub, compute recursively the # number of times that sub appears in the string, without the sub strings # overlapping. # # # strCount("catcowcat", "cat") → 2 # strCount("catcowcat", "cow") → 1 # strCount("catcowcat", "dog") → 0 # # Credit for this problem goes to Nick Parlante from CodingBat.com # Do not modify anything outside of the function or the function itself. # CODE START def getStrCount(str:str, sub:str) -> int: # CODE END # Press Ctrl+E (Command+E on mac) to test your code