Skip to content

Commit

Permalink
minor day 22 optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
kcaffrey committed Dec 22, 2023
1 parent 8862af0 commit 67871f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ Solutions for [Advent of Code](https://adventofcode.com/) in [Rust](https://www.
| [Day 19](./src/bin/19.rs) | `83.9µs` | `90.9µs` |
| [Day 20](./src/bin/20.rs) | `323.9µs` | `1.2ms` |
| [Day 21](./src/bin/21.rs) | `64.1µs` | `494.7µs` |
| [Day 22](./src/bin/22.rs) | `82.4µs` | `202.8µs` |
| [Day 22](./src/bin/22.rs) | `78.3µs` | `194.8µs` |

**Total: 16.62ms**
**Total: 16.61ms**
<!--- benchmarking table --->

---
Expand Down
4 changes: 3 additions & 1 deletion src/bin/22.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ pub fn part_two(input: &str) -> Option<u32> {
== 0;
if loose {
visited[supported] = true;
stack.push(supported);
if !tower.supports[supported].is_empty() {
stack.push(supported);
}
fall_count += 1;
}
}
Expand Down

0 comments on commit 67871f7

Please sign in to comment.