day24 package

Subpackages

Submodules

day24.day24 module

day24 solution.

day24.day24.get_intersection_2d(left: Hailstone, right: Hailstone) Vector2 | None[source]

Returns intersection of two hailstones.

day24.day24.main() None[source]

Loads input then solves.

day24.day24.part1(hailstones: list[Hailstone], valid_range: Vector2) int[source]

Solve part1: list of hailstones that are within a given rectangle.

day24.day24.part2(hailstones: list[Hailstone]) int[source]

Solve part2: a magic hailstone that passes through all other hailstones.

day24.day24.within_2d(point: Vector2, min_max: Vector2) bool[source]

Returns whether a point is inside a given rectangle.

x and y are both symmetric and defined by min_max.

Module contents

Day 24 solution.