update comments
This commit is contained in:
parent
3a39931d69
commit
c92bae4761
2 changed files with 4 additions and 7 deletions
|
@ -1,6 +1,3 @@
|
||||||
# AOC 23
|
# AOC 23
|
||||||
|
|
||||||
# Day 1 Trebuchet?!
|
Complete all of AoC 2023 in Rust. No specific constraints, not going for any kind of high speed or clean code.
|
||||||
|
|
||||||
`cr --bin d1_0`
|
|
||||||
|
|
||||||
|
|
|
@ -177,9 +177,9 @@ fn part2(input: String) -> Result<usize> {
|
||||||
// Figure out final score based on sliding window of known scores within the
|
// Figure out final score based on sliding window of known scores within the
|
||||||
// repeated pattern:
|
// repeated pattern:
|
||||||
//
|
//
|
||||||
// (cycles - repeated index) gives us the remaining times we need to run through. We
|
// (cycles - repeated index) gives us the remaining times we need to run through.
|
||||||
// then get the remainder of that divided by the difference of the current index minus
|
// We then get the remainder of that divided by the difference of the current
|
||||||
// all seen (total repeating count).
|
// index minus all seen (total repeating count).
|
||||||
answer = scores
|
answer = scores
|
||||||
[repeated_index - 1 + (cycles - repeated_index) % (seen.len() - repeated_index)];
|
[repeated_index - 1 + (cycles - repeated_index) % (seen.len() - repeated_index)];
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue