Commits

Steve McConville  committed d9f5598

solved 4 with python

  • Participants
  • Parent commits ccd1e09

Comments (0)

Files changed (1)

File 4/solution.py

+def euler4():
+    digits3 = xrange(100, 999)
+    set()
+
+    def times(L):
+        r = []
+        for x in L:
+            for y in L:
+                if x >= y:
+                    r.append(x*y)
+        return set(r)
+
+    def is_palindrome(N):
+        s = str(N)
+        return all(s[i] == s[-(i+1)] for i in xrange(len(s)/2))
+    return max(filter(is_palindrome, tuple(times(digits3))))