Created
April 5, 2011 03:50
-
-
Save ameerkat/902987 to your computer and use it in GitHub Desktop.
Brute force attempt at project euler #39
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def euler39brute(): | |
sum_count = [0] * 1001 | |
for a in range(2000/3 + 1): | |
if a%100 == 0: | |
print "|", | |
for b in range(a+1): | |
for c in range(a+1,1001-a-b): | |
if a**2 + b**2 == c**2: | |
sum_count[a+b+c] += 1 | |
return sum_count.index(max(sum_count)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment