From: Ummon Date: Wed, 6 Dec 2017 09:11:47 +0000 (+0100) Subject: Remove useless sh*t X-Git-Url: https://git.euphorik.ch/?a=commitdiff_plain;h=8c7b8ebc8d88a146f416dde12e9901772568152f;p=advent_of_code_2017.git Remove useless sh*t --- diff --git a/AdventOfCode2017/Day6.fs b/AdventOfCode2017/Day6.fs index 867d408..113c47d 100644 --- a/AdventOfCode2017/Day6.fs +++ b/AdventOfCode2017/Day6.fs @@ -1,9 +1,6 @@ module AdventOfCode2017.Day6 open System -open System.Linq - -type Blocks = int[] let parseInput (str : string) : int[] = str.Split ([| '\r'; '\t'; ' ' |], StringSplitOptions.RemoveEmptyEntries) |> Array.map int @@ -22,8 +19,8 @@ let inline (|=|) (a1 : 'a[]) (a2 : 'a[]) : bool = result (i + 1) result 0 -let nbRedistribution (blocks : Blocks) = - let rec next (previous : Blocks list) = +let nbRedistribution (blocks : int[]) = + let rec next (previous : int[] list) = let blocks = List.head previous |> Array.copy let i, max = blocks |> Array.indexed |> Array.maxBy snd blocks.[i] <- 0