From ded504b921af57a9e0efa35d7df037bb187a11b7 Mon Sep 17 00:00:00 2001 From: Ummon Date: Thu, 7 Dec 2017 10:29:10 +0100 Subject: [PATCH] Less verbose --- AdventOfCode2017/Day7.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AdventOfCode2017/Day7.fs b/AdventOfCode2017/Day7.fs index 2d4c252..827fee1 100644 --- a/AdventOfCode2017/Day7.fs +++ b/AdventOfCode2017/Day7.fs @@ -46,4 +46,4 @@ let rec findUnbalanced (tower : Tower) : (Tower * int) option = match tower.Above |> List.ofSeq |> List.groupBy weight |> List.sortBy (snd >> List.length) with | [ w1, [ unbalanced ]; w2, _ ] -> findUnbalanced unbalanced |> Option.orElse (Some (unbalanced, unbalanced.Weight + w2 - w1)) - | _ -> tower.Above |> Seq.tryPick (fun t -> findUnbalanced t) + | _ -> tower.Above |> Seq.tryPick findUnbalanced -- 2.45.2