I feel like im soo close but I cant even solve part 1.

Where did I go wrong??
https://git.gay/ChaoticLeah/advent-of-code-2025/src/branch/master/src/3/main.rs

#AdventOfCode
ChaoticLeah/advent-of-code-2025

Surely I will see this all the way through

git.gay
@ChaosKitsune max_by_key selects the last maximum value, not the first. (I used a very similar approach.)
@decivex unfortunately I found this out just before the comment but thanks for the reply.

Now ive switched to some weird .fold method. Is there a way to just tell rust to select the first max instead of the last or no?
@ChaosKitsune The way I did it was by using a tuple of (value, -(index as isize)) as the key for max_by_key.
@decivex huh is that code somewhere public? Im curious now. That does sound easier
day03/src/common.rs · master · decivex / Advent of Code 2025 · GitLab

GitLab.com

GitLab