Word break problem: Difference between revisions
Content deleted Content added
m →Functional Python: Minor simplification by currying |
|||
Line 783: | Line 783: | ||
def next(s): |
def next(s): |
||
return lambda w: parse( |
return lambda w: parse( |
||
w, go(s[len(w):]) |
|||
) if s.startswith(w) else [] |
|||
return lambda s: go(s) |
return lambda s: go(s) |