Jump to content

Word break problem: Difference between revisions

m
→‎Functional Python: Minor simplification by currying
m (→‎{{header|Javascript}}: (Minor simplification by currying))
m (→‎Functional Python: Minor simplification by currying)
Line 779:
def go(s):
return [Node(s)([])] if s in wds else (
concatMap(lambda w: next(s, w))(wds)
)
 
def next(s, w):
return lambda w: parse(w, go(s[len(w):])) if s.startswith(w) else []
 
return lambda s: go(s)
9,655

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.