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