mirror of
https://github.com/RussellChamp/advent-of-code-2025-cursor.git
synced 2026-10-27 23:52:34 +00:00
Optimize Day 2 solution: 41x faster Part 1, 18x faster Part 2
- Changed from brute-force iteration to generating invalid numbers directly - Part 1: 45.0ms → 1.1ms - Part 2: 69.6ms → 3.8ms - Total benchmark time: 119.38ms → 9.68ms
This commit is contained in:
1 parent
702221e78f
commit
491f89f523
2 files changed
+68
-32
No files matched your search
@@ -12,11 +12,11 @@ Solutions for [Advent of Code](https://adventofcode.com/) in [Rust](https://www.
|
||||
| Day | Part 1 | Part 2 |
|
||||
| :---: | :---: | :---: |
|
||||
| [Day 1](./src/bin/01.rs) | `102.5µs` | `123.5µs` |
|
||||
| [Day 2](./src/bin/02.rs) | `45.0ms` | `69.6ms` |
|
||||
| [Day 2](./src/bin/02.rs) | `1.1ms` | `3.8ms` |
|
||||
| [Day 3](./src/bin/03.rs) | `85.1µs` | `121.6µs` |
|
||||
| [Day 4](./src/bin/04.rs) | `244.2µs` | `4.1ms` |
|
||||
|
||||
**Total: 119.38ms**
|
||||
**Total: 9.68ms**
|
||||
<!--- benchmarking table --->
|
||||
|
||||
---
|
||||
|
||||
Reference in new issue
Block a user