Add solution for "Day 20: Race Condition", part 2
This commit is contained in:
@@ -15,7 +15,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <aoc/common/Grid.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include <aoc/framework/LinesSolver.hpp>
|
||||
|
||||
class RaceCondition
|
||||
@@ -29,9 +30,9 @@ class RaceCondition
|
||||
private:
|
||||
static constexpr char getStartChar();
|
||||
static constexpr char getWallChar();
|
||||
static constexpr int getCheatLength();
|
||||
const std::array<Point2, 8> doubleSteps_{ Point2::down * 2, Point2::downRight, Point2::right * 2,
|
||||
Point2::upRight, Point2::up * 2, Point2::upLeft, Point2::left * 2, Point2::downLeft };
|
||||
static constexpr int getPart1CheatLength();
|
||||
static constexpr int getPart2CheatLength();
|
||||
int threshold_;
|
||||
void checkCheat(const Point2& position, Grid<int>& times);
|
||||
bool tryFindNextPathPosition(std::vector<Point2>& path);
|
||||
void checkCheat(const std::vector<Point2>& path);
|
||||
};
|
||||
|
||||
@@ -36,6 +36,7 @@ class Point2
|
||||
int x, y;
|
||||
Point2();
|
||||
Point2(const int x, const int y);
|
||||
int calcManhattanDistance(const Point2& other) const;
|
||||
bool operator==(const Point2& rhs) const;
|
||||
bool operator!=(const Point2& rhs) const;
|
||||
bool operator<(const Point2& rhs) const;
|
||||
|
||||
Reference in New Issue
Block a user