Sfoglia il codice sorgente

Added solution to problem 52.

Taddeus Kroes 14 anni fa
parent
commit
67c40e5a28
1 ha cambiato i file con 19 aggiunte e 0 eliminazioni
  1. 19 0
      problem52.py

+ 19 - 0
problem52.py

@@ -0,0 +1,19 @@
+#!/usr/bin/python
+def digits(n):
+    return set(list(str(n)))
+
+x = 1
+
+while True:
+    found = True
+    d = digits(x)
+
+    for i in range(2, 7):
+        if digits(i * x) != d:
+            found = False
+
+    if found:
+        print x
+        break
+
+    x += 1