By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,331 Members | 1,109 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,331 IT Pros & Developers. It's quick & easy.

Re: Non Continuous Subsequences

P: n/a
Bruce Frederiksen:

Your solution is a bit different from what I was thinking about (I was
thinking about a generator function, with yield), but it works.

This line:
return itertools.chain(
itertools.imap(lambda ys: x + ys, ncsub(xs, s + p1)),
ncsub(xs, s + p2))
Can be written in a simpler way:
return chain((x + ys for ys in ncsub(xs, s + p1)), ncsub(xs, s + p2))

I'll think more about all this,
bye and thank you,
Jul 31 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.