Leftovers from day 11

This commit is contained in:
Smaug123
2023-12-11 22:35:19 +00:00
parent a24d28ab5c
commit 916e29c24e
2 changed files with 8 additions and 5 deletions

View File

@@ -1,7 +1,5 @@
namespace AdventOfCode2023
open System
[<RequireQualifiedAccess>]
module Day11 =
@@ -41,7 +39,7 @@ module Day11 =
let result = ResizeArray ()
let mutable prevCol = 0
for (_, c) in galaxies do
for _, c in galaxies do
if c > prevCol then
for j = prevCol + 1 to c - 1 do
result.Add j

View File

@@ -217,12 +217,17 @@ module Program =
let input = Path.Combine (dir.FullName, "day11.txt") |> File.ReadAllText
sw.Restart ()
let part1 = Day11.part1 input
let data = Day11.parse input
sw.Stop ()
Console.Error.WriteLine ((1_000.0 * float sw.ElapsedTicks / float Stopwatch.Frequency).ToString () + "ms parse")
sw.Restart ()
let part1 = Day11.solve data 2uL
sw.Stop ()
Console.WriteLine (part1.ToString ())
Console.Error.WriteLine ((1_000.0 * float sw.ElapsedTicks / float Stopwatch.Frequency).ToString () + "ms")
sw.Restart ()
let part2 = Day11.part2 input
let part2 = Day11.solve data 1_000_000uL
sw.Stop ()
Console.WriteLine (part2.ToString ())
Console.Error.WriteLine ((1_000.0 * float sw.ElapsedTicks / float Stopwatch.Frequency).ToString () + "ms")