Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
YouTube Security VideosGoogle Chrome: Unfinished Projects by Chrome: Joe Burrow’s Chess Set(21.09.2026 um 16:05 Uhr)
YouTube Security VideosGitHub: How to move AI from code completion to agentic workflows(21.09.2026 um 17:00 Uhr)
YouTube Security VideosGoogle Workspace: Why are we like this 😭 #Shorts(21.09.2026 um 16:15 Uhr)
Windows Tipps & SecurityNeues Elektroauto von Rolls-Royce wird äußerst exklusiv sein(21.09.2026 um 16:46 Uhr)
Windows Tipps & SecurityGooglebooks überraschen: Die beste KI-Funktion ist gar keine KI(21.09.2026 um 16:59 Uhr)
YouTube Security VideosGoogle Chrome: Unfinished Projects by Chrome: Joe Burrow’s Chess Set(21.09.2026 um 16:05 Uhr)
YouTube Security VideosGitHub: How to move AI from code completion to agentic workflows(21.09.2026 um 17:00 Uhr)
YouTube Security VideosGoogle Workspace: Why are we like this 😭 #Shorts(21.09.2026 um 16:15 Uhr)
Windows Tipps & SecurityNeues Elektroauto von Rolls-Royce wird äußerst exklusiv sein(21.09.2026 um 16:46 Uhr)
Windows Tipps & SecurityGooglebooks überraschen: Die beste KI-Funktion ist gar keine KI(21.09.2026 um 16:59 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Advent of Code '24 - Day 10: Hoof It

Advent of Code Day 10: Hoof It Link to Solution This one (like many other it seems) managed to inadvertently solve Part 2 whilst doing Part 1, or at least Part 2 required very little extra effort. Summary of Problem &…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!




Advent of Code Day 10: Hoof It



Link to Solution



This one (like many other it seems) managed to inadvertently solve Part 2 whilst doing Part 1, or at least Part 2 required very little extra effort.






Summary of Problem & Solution



I think where many of us devs went wrong today as we didn't fully understand the requirement of :




A trailhead's score is the number of 9-height positions reachable from that trailhead via a hiking trail.




But this could be misinterpreted as all the 9's from that trailhead not unique. However, alas it should be unique 9's, but it made for an easy solution to Part 2 (which is why many many quick Part2 solution times haha)






Part 1: Unique Paths to 9



The goal is to count how many unique 9 positions can be reached from each trailhead (0). This involves:



Finding all reachable 9 positions from each trailhead.

Using a HashSet of visited 9 positions (visitedEndPoints) to ensure uniqueness.



For each trailhead:

Traverse valid paths using the BFS (Breadth First Search) algorithm.



Keep track of all 9 positions reached from that trailhead (unique).



Finally:

Sum up the counts of unique 9 positions reachable from all trailheads.

This forms the "score" of each trailhead.






Part 2: Count All Distinct Paths



Here, the focus shifts to counting the number hiking trails from each trailhead. This involves:



Counting all possible paths (not just unique endpoints).



Problem Solved - As always feel free to give me a follow on Twitter where you can be notified of my articles on DevTo, FreeCodeCamp and other dev tips and tricks.

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Advent of Code '24 - Day 10: Hoof It

Thematisch verwandte Begriffe: Advent, Code, Hoof · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-94393 | When a user creates or edits a report inside an event, MISP can identify…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick