This commit is contained in:
parent
9b8ae4f350
commit
b5583ca46e
@ -46,14 +46,10 @@ fn solve(alloc: mem.Allocator, input: []const u8) !Solution {
|
|||||||
// Extrapolate
|
// Extrapolate
|
||||||
var next: isize = 0;
|
var next: isize = 0;
|
||||||
var prev: isize = 0;
|
var prev: isize = 0;
|
||||||
for (seqs.items) |seq| {
|
|
||||||
next += seq[seq.len - 1];
|
|
||||||
}
|
|
||||||
for (0..seqs.items.len) |i| {
|
for (0..seqs.items.len) |i| {
|
||||||
prev = seqs.items[seqs.items.len - i - 1][0] - prev;
|
const seq = seqs.items[seqs.items.len - i - 1];
|
||||||
}
|
prev = seq[0] - prev;
|
||||||
for (seqs.items) |seq| {
|
next += seq[seq.len - 1];
|
||||||
// Clean up
|
|
||||||
alloc.free(seq);
|
alloc.free(seq);
|
||||||
}
|
}
|
||||||
prev_sum += prev;
|
prev_sum += prev;
|
||||||
|
Loading…
Reference in New Issue
Block a user