Skip to content

Commit ffd8555

Browse files
committed
Update
1 parent 0d2f21d commit ffd8555

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

038.fut

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def pd19 : []i32 = [0, 1, 1, 1, 1, 1, 1, 1, 1, 1]
2+
3+
def ispd(n: i32) =
4+
let (i2l, _) = loop (l, num) = ((replicate 10 0), 100002 * n) while num > 0 do
5+
let l[num % 10] = 1 in (l, num / 10)
6+
in if map2 (==) i2l pd19 |> and then 100002 * n else 0
7+
8+
def euler038 = (9123...9876) |> map ispd |> i32.maximum
9+
10+
def main = euler038

0 commit comments

Comments
 (0)