initial commit
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
module _43
|
||||
open System
|
||||
open common
|
||||
let pandigitalDivisible =
|
||||
let comb (i : string) (j : string) =
|
||||
match i, j with
|
||||
| i,j when i.[1] = j.[0] && i.[2] = j.[1] -> Some(String.Concat((string i.[0]), j))
|
||||
| _ -> None
|
||||
|
||||
let prMul =
|
||||
[17;13;11;7;5;3;2]
|
||||
|> List.map
|
||||
(
|
||||
multiples
|
||||
>> Seq.map string
|
||||
>> Seq.skipWhile (String.length >> (>) 3)
|
||||
>> Seq.takeWhile (String.length >> (>) 4)
|
||||
)
|
||||
|
||||
|
||||
|
||||
// let lnth i l = List.nth l i
|
||||
// let lnthDivs i n l = lnth i l >> (%) n >> (=) 0
|
||||
// [0..9] |> Set.ofSeq |> permutations
|
||||
// |> Seq.filter (lnth 0 >> (<>) 0)
|
||||
// |> Seq.filter (lnth 3 >> (%) 2 >> (=) 0)
|
||||
// //|> Seq.filter (lnth 5 >> (%) 5 >> (=) 0)
|
||||
// |> Seq.length
|
||||
Reference in New Issue
Block a user