On Feb 28, 10:07 am, Mark Dickinson <[EMAIL PROTECTED]> wrote: > On Feb 28, 5:02 am, Michael Robertson <[EMAIL PROTECTED]> wrote: > > > Thanks again for your efforts here. This particular problem didn't > > appear in any course I took...certainly similar problems did. > > And here's the obligatory not-very-obfuscated one-liner: > > from itertools import combinations as c; boxings=lambda n,k:([s[i > +1]+~s[i] for i in range(k)] for s in [[-1]+list(t)+[n-~k] for t in > c(range(n-~k),k-1)])
This calls for an obfuscation metric, several books, and two personal references. What is ~k doing in there twice? (Aside: throw in an obligatority one too. Sigh.) -- http://mail.python.org/mailman/listinfo/python-list