Skip to content

Commit

Permalink
update leaderboard
Browse files Browse the repository at this point in the history
  • Loading branch information
shahata committed Dec 18, 2024
1 parent b5cb8e8 commit 22bbcf2
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 48 deletions.
4 changes: 2 additions & 2 deletions src/2024/day18.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export function part1(input, wh = 70, fallen = 1024) {
let bytes = input.split("\n");
let queue = [{ x: 0, y: 0, steps: 0 }];
let visited = new Set(["0,0", ...bytes.slice(0, fallen)]);
let visited = new Set(bytes.slice(0, fallen));
while (queue.length) {
let curr = queue.shift();
if (curr.x === wh && curr.y === wh) return curr.steps;
const neighbors = [
let neighbors = [
{ x: curr.x + 1, y: curr.y },
{ x: curr.x - 1, y: curr.y },
{ x: curr.x, y: curr.y + 1 },
Expand Down
Loading

0 comments on commit 22bbcf2

Please sign in to comment.