adventofcode-2021/day01/part2.lua
Felix Van der Jeugt 3db67bd012
get rid of capitals
2021-12-03 08:04:04 +01:00

11 lines
187 B
Lua

local count = 0
local a, b, c
for line in io.lines(arg[3]) do
d = tonumber(line)
if a ~= nil and a + b + c < b + c + d then
count = count + 1
end
a, b, c = b, c, d
end
print(count)