Created
June 15, 2011 04:39
-
-
Save alexgenco/1026493 to your computer and use it in GitHub Desktop.
Project Euler #8 in Python
This file contains hidden or 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
| # the problem asks for the largest product of 5 consecutive numbers in a 1000 digit number. | |
| # something tells me this could be even more succinct, maybe with just one list comprehension | |
| number = [ int(x) for x in list("73167 ... 63450") ] | |
| print max([ number[i] * number[i+1] * number[i+2] * number[i+3] * number[i+4] for i in range(len(number)-4) ]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment