Skip to content

Instantly share code, notes, and snippets.

@klen
Created May 20, 2013 06:56
Show Gist options
  • Select an option

  • Save klen/5610784 to your computer and use it in GitHub Desktop.

Select an option

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