From 7a8b7c994e8cac68486fe6e053946c4dcd5a1e2c Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 17 Dec 2021 18:48:12 +0100 Subject: [PATCH] 2021: day17: improvement ideas --- aoc2021/src/day17.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aoc2021/src/day17.rs b/aoc2021/src/day17.rs index 8a0181a..1def61b 100644 --- a/aoc2021/src/day17.rs +++ b/aoc2021/src/day17.rs @@ -1,3 +1,10 @@ +//! Improvement ideas: +//! +//! X and Y coordinates are independant, so we can compute them separately, and keep track of which +//! values of X and Y can ever reach the target area, and if so, keep the step numbers where they +//! match. Some cross referencing can then isolate the valid trajectories. +//! +//! This already runs in 1ms though so... maybe later use std::cmp::Ordering; use std::fmt::Write; use std::ops::RangeInclusive;