22 lines
441 B
Lua
22 lines
441 B
Lua
|
#!/usr/bin/env luajit
|
||
|
require("utils")
|
||
|
|
||
|
function isunique(v)
|
||
|
return #v == 2 or #v == 3 or #v == 4 or #v == 7
|
||
|
end
|
||
|
|
||
|
local entries = {}
|
||
|
local uniques = 0
|
||
|
for line in io.lines(arg[3]) do
|
||
|
local words = split(line, " ")
|
||
|
local patterns = { unpack(words, 1, 10) }
|
||
|
local values = { unpack(words, 12, #words) }
|
||
|
table.insert(entries, {
|
||
|
patterns = patterns,
|
||
|
values = values,
|
||
|
})
|
||
|
uniques = uniques + count(values, isunique)
|
||
|
end
|
||
|
|
||
|
print(uniques)
|