Skip to content

Commit

Permalink
day18
Browse files Browse the repository at this point in the history
  • Loading branch information
vslinko committed Dec 18, 2024
1 parent c4a8c09 commit ddfc5ff
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/day18.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use dary_heap::BinaryHeap;
use std::cmp::Ordering;
use std::fmt::Display;

const WIDTH: usize = 71;
const HEIGHT: usize = 71;
Expand Down Expand Up @@ -129,11 +128,11 @@ unsafe fn find_fastest_path_score(grid: &[bool; GRID_SIZE]) -> usize {
usize::MAX
}

pub fn part1(input: &str) -> impl Display {
pub fn part1(input: &str) -> usize {
unsafe { inner1(input) }
}

unsafe fn inner1(input: &str) -> impl Display {
unsafe fn inner1(input: &str) -> usize {
let input = input.as_bytes();
let mut grid = [true; GRID_SIZE];
let mut i = 0;
Expand Down Expand Up @@ -163,11 +162,11 @@ unsafe fn inner1(input: &str) -> impl Display {
find_fastest_path_score(&grid)
}

pub fn part2(input: &str) -> impl Display {
pub fn part2(input: &str) -> String {
unsafe { inner2(input) }
}

unsafe fn inner2(input: &str) -> impl Display {
unsafe fn inner2(input: &str) -> String {
let input = input.as_bytes();
let mut initial_grid = [true; GRID_SIZE];
let mut i = 0;
Expand Down

0 comments on commit ddfc5ff

Please sign in to comment.