Created
January 14, 2009 23:25
-
-
Save PEZ/47155 to your computer and use it in GitHub Desktop.
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
"""Find the largest palindrom that is the product of two three-digit factors: | |
http://projecteuler.net/index.php?section=problems&id=4""" | |
# Brute force | |
def big_products(max): | |
for a in xrange(100, 1000): | |
for b in xrange(100, 1000): | |
yield str(a * b) | |
max(int(p) for p in big_products(999) if p == p[::-1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment