Day 1: Dusty Shed
Megathread guidelines
- Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever)
- You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ if you prefer sending it through a URL
FAQ
- What is this?: Here is a post with a large amount of details: https://programming.dev/post/6637268
- Where do I participate?: https://adventofcode.com/
- Is there a leaderboard for the community?: We have a programming.dev leaderboard with the info on how to join in this post: https://programming.dev/post/6631465


Rust
let input = include_str!("../../input/2026/day_1.txt"); let mut recipes = HashMap::new(); input .split('\n') .map(|line| line.parse::<u32>().unwrap()) .for_each(|value| { *recipes.get_or_set_with_mut(value, || 0) += 1; }); let mut recipes = recipes.into_iter().collect::<Vec<(u32, i32)>>(); recipes.sort_by_key(|a| -a.1); let result = recipes[0].0 * recipes[1].0 * recipes[2].0; println!("{result}");Probably non-optimal, but still 1ms, so good enough for me.
Kinda bizarrely easy second task, only had to change one character.
For shits and giggles I tried it on my local LLM agent, it took a small amount of prompting, but solved it in about 5 mins.
The best part is this:
It so confidently multiplied 3 numbers together and got the answer wrong… first set was correct somehow, second was completely hallucinated.