13 lines
329 B
FSharp
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 |