projects
/
advent_of_code_2017.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
38d7846
)
Less verbose
author
Ummon
<greg.burri@gmail.com>
Thu, 7 Dec 2017 09:29:10 +0000
(10:29 +0100)
committer
Ummon
<greg.burri@gmail.com>
Thu, 7 Dec 2017 09:29:10 +0000
(10:29 +0100)
AdventOfCode2017/Day7.fs
patch
|
blob
|
history
diff --git
a/AdventOfCode2017/Day7.fs
b/AdventOfCode2017/Day7.fs
index
2d4c252
..
827fee1
100644
(file)
--- 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