Skip to content

Instantly share code, notes, and snippets.

@klen
Created May 20, 2013 06:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save klen/5610784 to your computer and use it in GitHub Desktop.
Save klen/5610784 to your computer and use it in GitHub Desktop.
from itertools import product, groupby
print sum([len(tuple(g)) ** 2 for _, g in groupby(sorted(map(sum, product(range(10), repeat=3))))])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment