maching strings
Posted
by kiran
on Stack Overflow
See other posts from Stack Overflow
or by kiran
Published on 2010-06-18T04:30:44Z
Indexed on
2010/06/18
4:33 UTC
Read the original article
Hit count: 168
python
Write two functions, called countSubStringMatch and countSubStringMatchRecursive that take two arguments, a key string and a target string. These functions iteratively and recursively count the number of instances of the key in the target string. You should complete definitions for
def countSubStringMatch(target,key): and def countSubStringMatchRecursive (target, key):
For the remaining problems, we are going to explore other substring matching ideas. These problems can be solved with either an iterative function or a recursive one. You are welcome to use either approach, though you may find iterative approaches more intuitive in these cases of matching linear structures.
© Stack Overflow or respective owner