Day 3
This commit is contained in:
parent
f8d4de16f6
commit
d75851155b
3 changed files with 383 additions and 0 deletions
300
day_3/input
Normal file
300
day_3/input
Normal file
|
@ -0,0 +1,300 @@
|
|||
RCMRQjLLWGTjnlnZwwnZJRZH
|
||||
qnvfhpSbvSppNddNdSqbbmmdPrwttJVrVPDVrJtHtwPZhrPJ
|
||||
BFpFzSSqSFFSvQsnWgCMjTLzng
|
||||
DbWVcVRRdlLffvtqjTWNgQ
|
||||
mJJMpsmrMrJSHJpsHrFHvBvgHvqfNvzffgTvfj
|
||||
mMhPjmjmFPJhMSGGcDRlwRdcLGPc
|
||||
qFcbmWFJqqWpRJcQWpqsQQQwSPCPrHRHCPdNZtSrSHwrNZ
|
||||
jGMjGLhhhgTvghgtGVjnNCrPVwZSZffSNSwHZZdH
|
||||
DvzDlvvhnjlMlglglGGhDLpqqcJWWtsmszpWbBBBmQmb
|
||||
SPLPHQbJSbPsvTLmfDvVDctvWhcDlD
|
||||
jdRRzzGgJqwrpMRMgdjlcVcWqfWWlfDlmmlWhB
|
||||
rwgRGdpGprNNLQLsbZJPsn
|
||||
GZhTVLztHrSzrRBz
|
||||
MJWjMvsfSCLSnrJn
|
||||
MjglcgWMdccvZGFtTDchLLLh
|
||||
rgDHBgBjRgRTgwzwthBnQwmBtB
|
||||
MsMpSfMsTGTFFLdFFFMFsnNmthNnzhthtwmWnznz
|
||||
pZMpJdvJMGRHVJJTVHjb
|
||||
TQVqZVBcBBdBfbpN
|
||||
zvzrtCshrntCHslPMMMFpZHbNSpb
|
||||
hLWhGLttsvLvrrWvhzVmQgwJZTRcggTjGcgT
|
||||
SqRGLHtSbtNTbhjFTjDDpF
|
||||
WwgJgmdmMdwPDVQQBBhSBFwV
|
||||
JMPlmlSldWZmRqtLsRGRtvls
|
||||
mZvmvPNmlNJPJzzmgNvNgdqqdBSpfHBqSsHqHfwpsffq
|
||||
nhDQDrwLrVVnqfGnsBGBGGsH
|
||||
VjCDMhbDjLjtFhtLhLhQjNZcZP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mR
|
||||
CHGCHFcZvCrchrZrhsVtsBQjMstfZMMBgg
|
||||
NNqwDLmDjJgQBmVQ
|
||||
wdWLLTgWRTWcCcbrHCHhGW
|
||||
bTZZvNjNjLgTCHcWhccfhWJdhvnc
|
||||
mnFFmPGSwRPShzVPPWPdhhzr
|
||||
FRtBFGBMFQFttRwtZgTjCTnQNbNLjTCH
|
||||
bJSqrSpDJbSNbFjSFCfPWGcwGWPrcTCfwr
|
||||
tRtLhDsvhQZlHRhRtQQnCnCcdwCPwTwdGcGP
|
||||
HsHvsmBZvmvsmBhHvLssVqDSNgFMDzgbbDVJzbpMVq
|
||||
nSSDHRRRQRBCLCQC
|
||||
qGmfPzGmGlrrrpfrqlzrJtLvBlhQbSCvbtCtlFhLFC
|
||||
zzpmqqJJVVfJfPfMpfdHNndsNwDSMSDDNcsc
|
||||
CscQsVMhCsMsMHhhVthtwmgZNRqzWLBRLRLmBWmZWBND
|
||||
JQJdddrjrLqBgDBq
|
||||
QbFlTffpMbMnsPCh
|
||||
gDdbVbVDddDfVfWQfBRLQZsZLRQQ
|
||||
FCCTrGCMStwGHTtTWLQhLZrlRssRhRhp
|
||||
FSHqtFTmFwmCsSwGTHtMTSdjjcdnVddgzmbVmjmndbbD
|
||||
JtBBMcLWLdfFLhMttcWWhfWLrTRGFsbwTmRGwmwbbCTGGsbD
|
||||
PzQpSQQQvzVvpzHqjvNvQSvGRmmTDVRDmsGsRGsrcDcDGC
|
||||
cQPHSPvPvZHqcZjzpZjnZNtWlLdtldJWfnfhlJJtLdMg
|
||||
nPPssTBnMJPdtHPVHtRhpv
|
||||
bSSgGFWDgWwDFFlmWlcShqdpRqpVcHvvnqpvpRHd
|
||||
bGFnGljgSsjBCTBszz
|
41
day_3/main.lua
Normal file
41
day_3/main.lua
Normal file
|
@ -0,0 +1,41 @@
|
|||
function find_same(first, second)
|
||||
for c in first:gmatch('.') do
|
||||
if string.find(second, c) ~= nil then
|
||||
return c
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function priority(char)
|
||||
dec = string.byte(char)
|
||||
if dec & 0x20 == 0 then
|
||||
-- Uppercase
|
||||
return dec - string.byte('A') + 27
|
||||
else
|
||||
-- Lowercase
|
||||
return dec - string.byte('a') + 1
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
file = io.open('input')
|
||||
sacks = {}
|
||||
for line in file:lines() do
|
||||
table.insert(sacks, line)
|
||||
end
|
||||
|
||||
total = 0
|
||||
for i, sack in pairs(sacks) do
|
||||
local mid = math.floor(string.len(sack) / 2)
|
||||
local first = string.sub(sack, 0, mid)
|
||||
local second = string.sub(sack, mid + 1)
|
||||
|
||||
local same = find_same(first, second)
|
||||
total = total + priority(same)
|
||||
print(same, total)
|
||||
end
|
||||
|
||||
print(total)
|
||||
|
||||
|
42
day_3/main2.lua
Normal file
42
day_3/main2.lua
Normal file
|
@ -0,0 +1,42 @@
|
|||
function find_same(first, second, third)
|
||||
for c in first:gmatch('.') do
|
||||
if string.find(second, c) ~= nil and string.find(third, c) ~= nil then
|
||||
return c
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function priority(char)
|
||||
dec = string.byte(char)
|
||||
if dec & 0x20 == 0 then
|
||||
-- Uppercase
|
||||
return dec - string.byte('A') + 27
|
||||
else
|
||||
-- Lowercase
|
||||
return dec - string.byte('a') + 1
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
file = io.open('input')
|
||||
sacks = {}
|
||||
for line in file:lines() do
|
||||
table.insert(sacks, line)
|
||||
end
|
||||
|
||||
total = 0
|
||||
for i = 1, math.floor(#sacks / 3) do
|
||||
local i0 = i - 1
|
||||
local first = sacks[i0 * 3 + 1]
|
||||
local second = sacks[i0 * 3 + 2]
|
||||
local third = sacks[i0 * 3 + 3]
|
||||
|
||||
local same = find_same(first, second, third)
|
||||
total = total + priority(same)
|
||||
print(same, total)
|
||||
end
|
||||
|
||||
print(total)
|
||||
|
||||
|
Reference in a new issue