GitShow/BurntSushi/advent-of-code
BurntSushi

advent-of-code

Rust solutions to AoC 2018

by BurntSushi
Star on GitHubFork

Rust

478 stars27 forks2 contributorsQuiet · 5y agoSince 2018Unlicense

Meet the team

See all 2 on GitHub →
BurntSushi
BurntSushi37 contributions
schubart
schubart1 contribution

Languages

View on GitHub →
Rust99.8%
Shell0.2%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

2 of 6 standards met

Community profile →
42
✓README✓License○Contributing○Code of Conduct○Issue Template○PR Template

Recent fixes

View closed PRs →
xehpuk
04: Decremented array lengthMergedPR

Guards can never sleep at minute 59 because that's the last chance to wake up.

xehpuk · 2y ago
schubart
Simplify handling of regex mismatchMergedPR
schubart · 5y ago
modulitos
try using an array instead of HashMap<u32, u32>MergedPR

Hi @BurntSushi 👋 First, I want to send thanks for sharing these Advent of Code solutions. Having a set of idiomatic solutions is very motivating as I teach myself Rust and work through these exercises 🎉 As I was solving the problem for Day 4, I was curious why you chose to use a for instead of an array. Since the minute that a guard can be asleep is limited to 0-59, wouldn't an array of is a better representation? It seems like using an array instead of a HashMap ensures that we limit the possible minutes that the guards can be asleep to 60, thus enforcing the principle of "making illegal states unrepresentable". To help clarify this idea, I refactored the hashmap for in this PR, and tested the inputs to ensure there were no regressions: aoc04$ cargo run part 1, product: 240 part 2, product: 4455 aoc04$ cargo run part 1, product: 19830 part 2, product: 43695 Perhaps I'm missing something, but it seems like this PR structures the data into a better representation? Or maybe this is just a trivial change? Either way, I would love to hear your thoughts 🙏

modulitos · 6y ago
Structured data for AI agents

Repository: BurntSushi/advent-of-code. Description: Rust solutions to AoC 2018 Stars: 478, Forks: 27. Primary language: Rust. Languages: Rust (99.8%), Shell (0.2%). License: Unlicense. Open PRs: 0, open issues: 0. Last activity: 5y ago. Community health: 42%. Top contributors: BurntSushi, schubart.

·@ofershap

Replace github.com with gitshow.dev