diff --git a/index.html b/index.html index fa67e032..0577f6f2 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/2024/day01.html b/src/2024/day01.html new file mode 100644 index 00000000..5e7167ba --- /dev/null +++ b/src/2024/day01.html @@ -0,0 +1,96 @@ + + + + + Day 1 - Advent of Code 2024 + + + + + + +
+
+

Advent of Code

+ +
Shahar Talmi (AoC++) 2*
+
+
+

   $year=2024;

+
+
+
+

--- Day 1: Historian Hysteria ---

The Chief Historian is always present for the big Christmas sleigh launch, but nobody has seen him in months! Last anyone heard, he was visiting locations that are historically significant to the North Pole; a group of Senior Historians has asked you to accompany them as they check the places they think he was most likely to visit.

+

As each location is checked, they will mark it on their list with a star. They figure the Chief Historian must be in one of the first fifty places they'll look, so in order to save Christmas, you need to help them get fifty stars on their list before Santa takes off on December 25th.

+

Collect stars by solving puzzles. Two puzzles will be made available on each day in the Advent calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants one star. Good luck!

+

You haven't even left yet and the group of Elvish Senior Historians has already hit a problem: their list of locations to check is currently empty. Eventually, someone decides that the best place to check first would be the Chief Historian's office.

+

Upon pouring into the office, everyone confirms that the Chief Historian is indeed nowhere to be found. Instead, the Elves discover an assortment of notes and lists of historically significant locations! This seems to be the planning the Chief Historian was doing before he left. Perhaps these notes can be used to determine which locations to search?

+

Throughout the Chief's office, the historically significant locations are listed not by name but by a unique number called the location ID. To make sure they don't miss anything, The Historians split into two groups, each searching the office and trying to create their own complete list of location IDs.

+

There's just one problem: by holding the two lists up side by side (your puzzle input), it quickly becomes clear that the lists aren't very similar. Maybe you can help The Historians reconcile their lists?

+

For example:

+
3   4
+4   3
+2   5
+1   3
+3   9
+3   3
+
+

Maybe the lists are only off by a small amount! To find out, pair up the numbers and measure how far apart they are. Pair up the smallest number in the left list with the smallest number in the right list, then the second-smallest left number with the second-smallest right number, and so on.

+

Within each pair, figure out how far apart the two numbers are; you'll need to add up all of those distances. For example, if you pair up a 3 from the left list with a 7 from the right list, the distance apart is 4; if you pair up a 9 with a 3, the distance apart is 6.

+

In the example list above, the pairs and distances would be as follows:

+ +

To find the total distance between the left list and the right list, add up the distances between all of the pairs you found. In the example above, this is 2 + 1 + 0 + 1 + 2 + 5, a total distance of 11!

+

Your actual left and right lists contain many location IDs. What is the total distance between your lists?

+
+

Your puzzle answer was 2285373.

--- Part Two ---

Your analysis only confirmed what everyone feared: the two lists of location IDs are indeed very different.

+

Or are they?

+

The Historians can't agree on which group made the mistakes or how to read most of the Chief's handwriting, but in the commotion you notice an interesting detail: a lot of location IDs appear in both lists! Maybe the other numbers aren't location IDs at all but rather misinterpreted handwriting.

+

This time, you'll need to figure out exactly how often each number from the left list appears in the right list. Calculate a total similarity score by adding up each number in the left list after multiplying it by the number of times that number appears in the right list.

+

Here are the same example lists again:

+
3   4
+4   3
+2   5
+1   3
+3   9
+3   3
+
+

For these example lists, here is the process of finding the similarity score:

+ +

So, for these example lists, the similarity score at the end of this process is 31 (9 + 4 + 0 + 0 + 9 + 9).

+

Once again consider your left and right lists. What is their similarity score?

+
+

Your puzzle answer was 21142653.

Both parts of this puzzle are complete! They provide two gold stars: **

+

At this point, you should return to your Advent calendar and try another puzzle.

+

If you still want to see it, you can get your puzzle input.

+

You can also this puzzle.

+
+ + diff --git a/src/2024/events.html b/src/2024/events.html new file mode 100644 index 00000000..8c455704 --- /dev/null +++ b/src/2024/events.html @@ -0,0 +1,48 @@ + + + + + Events - Advent of Code 2024 + + + + + + +
+
+

Advent of Code

+ +
Shahar Talmi (AoC++) 2*
+
+
+

   $year=2024;

+
+
+
+
+

From here, you can access all of the events (and the corresponding puzzles, leaderboards, stats, etc) ever run on Advent of Code:

+ + + + + + + + + + +

Total stars: 452*

+
+ + diff --git a/src/2024/index.html b/src/2024/index.html new file mode 100644 index 00000000..66078c66 --- /dev/null +++ b/src/2024/index.html @@ -0,0 +1,117 @@ + + + + + Advent of Code 2024 + + + + + + +
+
+

Advent of Code

+ +
Shahar Talmi (AoC++) 2*
+
+
+

   $year=2024;

+
+
+
+ +
       .--'~ ~ ~|        .-' *       \  /     '-.   1 **
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/src/2024/leaderboard.html b/src/2024/leaderboard.html new file mode 100644 index 00000000..98219753 --- /dev/null +++ b/src/2024/leaderboard.html @@ -0,0 +1,230 @@ + + + + + Leaderboard - Advent of Code 2024 + + + + + + +
+
+

Advent of Code

+ +
Shahar Talmi (AoC++) 2*
+
+
+

   $year=2024;

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+

First to get both stars on Day 1:

+
1) 01 Dec 2024, 00:06:47 Tomas Peluritis
+
2) 01 Dec 2024, 00:07:43 Sergey Ilyevsky
+
3) 01 Dec 2024, 00:09:45 Shahar Talmi
+
4) 01 Dec 2024, 00:13:20 Snir Sharristh
+
5) 01 Dec 2024, 00:13:31 Domantas Bazys
+
6) 01 Dec 2024, 00:19:53 Nachshon Schwartz
+
7) 01 Dec 2024, 00:23:17 Eddie Erlich
+
8) 01 Dec 2024, 00:26:11 Rostyslav Makhanko
+
9) 01 Dec 2024, 00:31:17 Reut Svr
+
+

First to get the first star on Day 1:

+
1) 01 Dec 2024, 00:03:55 Tomas Peluritis
+
2) 01 Dec 2024, 00:05:08 Sergey Ilyevsky
+
3) 01 Dec 2024, 00:06:02 Shahar Talmi
+
4) 01 Dec 2024, 00:09:26 Snir Sharristh
+
5) 01 Dec 2024, 00:10:31 Domantas Bazys
+
6) 01 Dec 2024, 00:16:16 Nachshon Schwartz
+
7) 01 Dec 2024, 00:16:56 Eddie Erlich
+
8) 01 Dec 2024, 00:20:59 Rostyslav Makhanko
+
9) 01 Dec 2024, 00:28:08 Reut Svr
+
10) 01 Dec 2024, 00:30:23 Idan Levi
+
+
+ + diff --git a/src/2024/solver.html b/src/2024/solver.html new file mode 100644 index 00000000..6d47b33d --- /dev/null +++ b/src/2024/solver.html @@ -0,0 +1,72 @@ + + + + + Solver - Advent of Code 2024 + + + + + + +
+
+

Advent of Code

+ +
Shahar Talmi (AoC++) 2*
+
+
+

   $year=2024;

+
+
+
+ + +
+

--- Automatic Solver ---

+

Go to the Advent of Code site and open the + Application tab in Chrome DevTools. Copy the value of the session cookie and paste it here to see + the answers for your puzzle inputs. +

+
+
+

Session:

+
+

+      
+    
+ + diff --git a/src/utils/solver.js b/src/utils/solver.js index ed28ded8..0314ded5 100644 --- a/src/utils/solver.js +++ b/src/utils/solver.js @@ -76,7 +76,8 @@ function getAllYears() { async function takeScreenshots(year) { if (year !== getAllYears().at(-1)) return; const browser = await chromium.launch(); - const clip = { x: 0, y: 0, width: 1030, height: 420 }; + const height = 208.16 + getAllYears().length * 23.5; + const clip = { x: 0, y: 0, width: 1030, height }; const page = await browser.newPage(); await page.goto(resolve(import.meta.url, `../${year}/events.html`)); await page.waitForTimeout(1000); diff --git a/static/screenshot-events.png b/static/screenshot-events.png index 584fff44..30fd0a1f 100644 Binary files a/static/screenshot-events.png and b/static/screenshot-events.png differ diff --git a/static/screenshot-solver.png b/static/screenshot-solver.png index bd63a62c..d2b16877 100644 Binary files a/static/screenshot-solver.png and b/static/screenshot-solver.png differ