Make day 08 ready for big boi input
20MB input still runs in 0.7ms :umu:
This commit is contained in:
parent
27ff0996cb
commit
4d2cc20f0e
@ -61,7 +61,7 @@ fn part2(commands: &Vec<Command>, seen: &mut Vec<bool>, mut index: i32, mut acc:
|
||||
seen[index as usize] = true;
|
||||
match commands[index as usize] {
|
||||
Command::NOP(x) => {
|
||||
if !changed {
|
||||
if !changed && index > -x {
|
||||
if let Some(n) = part2(commands, seen, index + x, acc, true) {
|
||||
return Some(n);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user