day06 package

Subpackages

Submodules

day06.day6 module

Day06 solution.

class day06.day6.Race(time: int, record_distance: int)[source]

Bases: object

Simple class representing a race and its record.

record_distance: int
time: int
class day06.day6.RaceStrat(charge_time: int, run_time: int)[source]

Bases: object

class representing a strategy (charge time + run_time).

charge_time: int
property distance: int

Returns how far we moved.

run_time: int
property speed: int

Return the speed after the charge time.

day06.day6.calculate_constant_time(race: Race) int[source]

TL;DR Quadratic formula.

day06.day6.calculate_race(race: Race) int[source]

Naive calcuation of a race.

day06.day6.get_giga_race(races: list[Race]) Race[source]

Converts from a list of races into one giga race.

day06.day6.main() None[source]

Solves Day 6.

day06.day6.part1(races: list[Race]) int[source]

Returns the sum of the amnount of ways we can win each race.

day06.day6.part2(race: Race) int[source]

Return amoutn of ways we can win the race.

day06.day6.read_inputs(path: str) list[Race][source]

Disgusting but short i guess.

Module contents

day06 solution.