Back Clear
# Your Problem: # Given a string and a non-empty substring sub, compute recursively the # largest substring which starts and ends with sub and return its length. # # # strDist("catcowcat", "cat") → 9 # strDist("catcowcat", "cow") → 3 # strDist("cccatcowcatxx", "cat") → 9 # # 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 getStrDist(str:str, sub:str) -> int: # CODE END # Press Ctrl+E (Command+E on mac) to test your code