day 9 part 2
This commit is contained in:
parent
592d4fe2c2
commit
157915cae5
1 changed files with 1 additions and 1 deletions
|
@ -30,7 +30,7 @@ fn main() -> Result<()> {
|
|||
}
|
||||
let mut prediction = 0;
|
||||
for seq in sequences.iter().rev() {
|
||||
prediction += seq.last().unwrap();
|
||||
prediction = seq.first().unwrap() - prediction;
|
||||
}
|
||||
println!("{prediction}");
|
||||
sum += prediction;
|
||||
|
|
Loading…
Reference in a new issue