mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-25 21:00:31 +01:00
Slightly more efficient O(kn) implementation
This commit is contained in:
@@ -72,9 +72,7 @@ fn scenery<'a>(
|
|||||||
|
|
||||||
if i > 0 {
|
if i > 0 {
|
||||||
*score *= visible;
|
*score *= visible;
|
||||||
for s in 0..=val {
|
last_seen[..=(val as usize)].fill(i);
|
||||||
last_seen[s as usize] = i;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
*score = 0;
|
*score = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user