Skip to content

Instantly share code, notes, and snippets.

@eric-wieser
Forked from kragniz/2.py
Created August 4, 2012 09:55
Show Gist options
  • Save eric-wieser/3256477 to your computer and use it in GitHub Desktop.
Save eric-wieser/3256477 to your computer and use it in GitHub Desktop.
A2S 2
#!/usr/bin/env python
import itertools
def f(a, b, c, d):
return a*b + b*c + c*d + a*d
print max(f(*p) for p in itertools.permutations([1,2,3,4]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment