Files
project-euler/22.fs
T
2025-08-03 20:16:55 -07:00

13 lines
329 B
FSharp

module _22
open System.IO
let nameScores =
let names =
File.ReadAllLines(@"22_names.txt")
|> Seq.collect (fun l -> l.Split(','))
|> Seq.map (fun w -> w.Substring(1, w.Length - 2))
|> Seq.sort
names
|> Seq.mapi (fun i name -> (i + 1) * common.wordValue name)
|> Seq.sum