day 8 done
This commit is contained in:
+748
-1
@@ -1 +1,748 @@
|
|||||||
Paste any inputs into this file.
|
LLLRLRLRLLRRRLRRRLRRRLLLRLRLLRRLLRRLRLRLLRLRLRRLLRRRLRLLRRLRRRLRRLLLRRRLRRRLRRRLLLLRRLRRRLRLRRRLRRLLRLRLRRRLRRRLRRLRRRLLLLLLRLRRRLLLLRLRRRLRRRLRLRRLRLRLRLRLRRRLLRRLRLRRLRRLRRLLRLLLRRLRLLRRLRLRRLRRRLRRLLRLRLRLRRLLRLLRRLLLRLRLRRRLRRLLRRRLRLRLRRLLRLRLRLRRLRLRLRRLRRLLRRLRRRLRRRLLLRRRR
|
||||||
|
|
||||||
|
MQF = (DDG, LSH)
|
||||||
|
QJP = (PCT, XKJ)
|
||||||
|
JXF = (PMG, NBN)
|
||||||
|
JCK = (QCD, NRG)
|
||||||
|
LPD = (NTM, NTM)
|
||||||
|
DLN = (TXM, QRG)
|
||||||
|
MTG = (KGC, DMM)
|
||||||
|
KFV = (FXH, QLX)
|
||||||
|
SCJ = (HQH, XSD)
|
||||||
|
JKJ = (PMX, MHH)
|
||||||
|
SJK = (JXM, GRQ)
|
||||||
|
CJZ = (DPF, RMT)
|
||||||
|
QXM = (HGC, SMX)
|
||||||
|
XJS = (NRV, CCL)
|
||||||
|
QLB = (RCH, QVQ)
|
||||||
|
KDB = (QKT, BJB)
|
||||||
|
FCX = (DXG, SGQ)
|
||||||
|
PCT = (DXR, PTS)
|
||||||
|
MGJ = (FKF, HNG)
|
||||||
|
VBN = (RBK, JPL)
|
||||||
|
TRH = (SRT, VJV)
|
||||||
|
PGK = (SNP, QLP)
|
||||||
|
XVK = (KFK, QQC)
|
||||||
|
SXC = (XTB, DPQ)
|
||||||
|
HNG = (VXF, MVH)
|
||||||
|
QHT = (TTD, LBH)
|
||||||
|
LMK = (QQT, QTP)
|
||||||
|
DXR = (KCT, KQS)
|
||||||
|
FSA = (RXT, BLP)
|
||||||
|
GHK = (JMM, VBN)
|
||||||
|
DMM = (VQM, LTG)
|
||||||
|
FBQ = (FSV, GHJ)
|
||||||
|
KCN = (QVR, TDG)
|
||||||
|
KBF = (XNM, HBL)
|
||||||
|
KJP = (FKG, CJZ)
|
||||||
|
JLH = (CKG, XLV)
|
||||||
|
RJX = (KKN, RJH)
|
||||||
|
PFS = (BVC, SXR)
|
||||||
|
DHM = (HXV, FRV)
|
||||||
|
KFK = (PLL, GQC)
|
||||||
|
CNB = (KNS, HVP)
|
||||||
|
DDG = (QTS, VRJ)
|
||||||
|
QVT = (JCK, DJQ)
|
||||||
|
LRB = (TXD, MPR)
|
||||||
|
DMS = (QVD, MFS)
|
||||||
|
PMJ = (LNN, NPJ)
|
||||||
|
BXD = (MLL, QKQ)
|
||||||
|
DGF = (FMX, PKP)
|
||||||
|
RHQ = (RJH, KKN)
|
||||||
|
MRG = (TNN, LLX)
|
||||||
|
BBM = (VFP, VGF)
|
||||||
|
PLP = (BBK, KFX)
|
||||||
|
RSN = (SBN, DQF)
|
||||||
|
XTP = (HMT, XNV)
|
||||||
|
LLX = (KBF, TDV)
|
||||||
|
KHR = (QGL, NCM)
|
||||||
|
PFB = (SXR, BVC)
|
||||||
|
NKP = (JTF, BJH)
|
||||||
|
RPH = (RSN, VBM)
|
||||||
|
HBL = (LVT, JXF)
|
||||||
|
CBC = (LRB, QGN)
|
||||||
|
FXH = (GCH, KBD)
|
||||||
|
QTF = (KVL, DLS)
|
||||||
|
RPQ = (FJB, RMD)
|
||||||
|
SLD = (MSH, NSN)
|
||||||
|
PXF = (QXM, HDF)
|
||||||
|
QBJ = (RDQ, DJH)
|
||||||
|
QPH = (RKJ, CSC)
|
||||||
|
TVF = (JMC, MTV)
|
||||||
|
MJM = (DLM, BQS)
|
||||||
|
XQV = (LCD, QCL)
|
||||||
|
KQH = (SJK, BPR)
|
||||||
|
CSC = (BLD, PDP)
|
||||||
|
BLP = (XVK, LJB)
|
||||||
|
BBK = (DJT, LLJ)
|
||||||
|
PSH = (GQH, RBQ)
|
||||||
|
RMD = (XQV, KFT)
|
||||||
|
TJJ = (QLV, HPG)
|
||||||
|
STS = (BSB, TMP)
|
||||||
|
FPN = (TCK, GLD)
|
||||||
|
JPF = (VCS, CMQ)
|
||||||
|
NVX = (TLD, GMD)
|
||||||
|
XLV = (LKV, QNK)
|
||||||
|
GSF = (CKS, BVB)
|
||||||
|
QHR = (KTV, KPG)
|
||||||
|
JRX = (FPN, DTC)
|
||||||
|
KGC = (VQM, LTG)
|
||||||
|
SSK = (NHP, NHP)
|
||||||
|
GLN = (RMX, NGG)
|
||||||
|
NPJ = (QRV, KTB)
|
||||||
|
PCP = (XSF, BPL)
|
||||||
|
JTF = (LSL, BHB)
|
||||||
|
TDV = (HBL, XNM)
|
||||||
|
FKV = (JVF, HKK)
|
||||||
|
GSG = (QJP, CLF)
|
||||||
|
QNK = (XNQ, CGQ)
|
||||||
|
RQT = (QVQ, RCH)
|
||||||
|
XNT = (RKM, XRV)
|
||||||
|
JMM = (RBK, JPL)
|
||||||
|
LSL = (NGH, KCN)
|
||||||
|
QLQ = (TLV, KDN)
|
||||||
|
KXR = (KRH, KRH)
|
||||||
|
QLV = (GSR, BQV)
|
||||||
|
PMG = (LPH, XFB)
|
||||||
|
VNF = (LVQ, HHG)
|
||||||
|
CSS = (RKK, RQN)
|
||||||
|
HGR = (PVX, LFX)
|
||||||
|
QGN = (MPR, TXD)
|
||||||
|
XNQ = (GTJ, LXQ)
|
||||||
|
QQC = (GQC, PLL)
|
||||||
|
CKR = (KQH, HQD)
|
||||||
|
TLD = (JLJ, VFL)
|
||||||
|
XSD = (TTQ, LDQ)
|
||||||
|
FXF = (BXS, LMQ)
|
||||||
|
ZZZ = (QBJ, MJJ)
|
||||||
|
HPG = (GSR, BQV)
|
||||||
|
LJC = (RNF, FNK)
|
||||||
|
CCL = (DXF, HRM)
|
||||||
|
FQR = (QBF, CLH)
|
||||||
|
GHJ = (MPS, NRB)
|
||||||
|
LLJ = (NVX, BTR)
|
||||||
|
MCQ = (RTG, CTK)
|
||||||
|
PLL = (DJD, FTV)
|
||||||
|
BLD = (XGL, NDH)
|
||||||
|
MLL = (NHV, PPJ)
|
||||||
|
KDN = (LLS, DLN)
|
||||||
|
KKN = (DCC, CCH)
|
||||||
|
FHB = (TCJ, VLF)
|
||||||
|
HCC = (RDN, TRJ)
|
||||||
|
TGV = (TKF, CFG)
|
||||||
|
TKB = (SVJ, KHH)
|
||||||
|
QDN = (RXG, PFF)
|
||||||
|
GQN = (RKT, NKK)
|
||||||
|
FLV = (TLV, KDN)
|
||||||
|
KTV = (LKK, VGH)
|
||||||
|
XHQ = (JLX, SNS)
|
||||||
|
MHN = (DHV, KMD)
|
||||||
|
DLD = (SSQ, LDK)
|
||||||
|
DKD = (CKR, JPC)
|
||||||
|
SRD = (KPP, LFS)
|
||||||
|
LVT = (PMG, NBN)
|
||||||
|
KPP = (FLQ, XTX)
|
||||||
|
BQV = (GLN, NQG)
|
||||||
|
BSB = (KHR, FGL)
|
||||||
|
HGC = (DBX, QTF)
|
||||||
|
DSF = (RBQ, GQH)
|
||||||
|
GRQ = (MVQ, RVP)
|
||||||
|
JGT = (SFN, GQT)
|
||||||
|
HDF = (SMX, HGC)
|
||||||
|
QBF = (VKF, XHQ)
|
||||||
|
QKM = (JTV, LPP)
|
||||||
|
LJB = (QQC, KFK)
|
||||||
|
NTH = (QQV, MHS)
|
||||||
|
QTX = (FMX, PKP)
|
||||||
|
HCQ = (FFT, CBC)
|
||||||
|
XKJ = (DXR, PTS)
|
||||||
|
BHH = (KPP, LFS)
|
||||||
|
GRH = (QLQ, FLV)
|
||||||
|
FNX = (MJX, PFZ)
|
||||||
|
HQN = (CKS, BVB)
|
||||||
|
SJV = (CGF, VKD)
|
||||||
|
RDL = (QJV, MLX)
|
||||||
|
MFR = (DMF, CFD)
|
||||||
|
LPF = (SRD, BHH)
|
||||||
|
HCP = (MPV, NVL)
|
||||||
|
KNS = (VCD, LJL)
|
||||||
|
CDX = (LLX, TNN)
|
||||||
|
SGS = (KMC, RQK)
|
||||||
|
HQS = (NKP, FRN)
|
||||||
|
QVD = (VML, QHT)
|
||||||
|
NRG = (LDS, SCH)
|
||||||
|
BVB = (HCP, NVM)
|
||||||
|
RBK = (QLB, RQT)
|
||||||
|
MPV = (CGR, TSC)
|
||||||
|
VFP = (JXP, QCM)
|
||||||
|
QFS = (DFQ, FHB)
|
||||||
|
FTK = (LSH, DDG)
|
||||||
|
TJH = (KPL, KTR)
|
||||||
|
HQF = (MQF, FTK)
|
||||||
|
FGX = (HVP, KNS)
|
||||||
|
DDK = (NTM, JNC)
|
||||||
|
BJC = (SQK, RGB)
|
||||||
|
HVP = (VCD, LJL)
|
||||||
|
LTG = (RMV, CJC)
|
||||||
|
BNR = (CSS, RBN)
|
||||||
|
GQT = (LCN, DTK)
|
||||||
|
XSF = (BGT, FCN)
|
||||||
|
SSQ = (KTL, JMR)
|
||||||
|
RNH = (BXH, BXH)
|
||||||
|
FTV = (CMM, PBL)
|
||||||
|
QRK = (TSF, QFS)
|
||||||
|
CLR = (NFS, PGK)
|
||||||
|
SRJ = (PFV, SHX)
|
||||||
|
FQT = (QKT, BJB)
|
||||||
|
FRN = (BJH, JTF)
|
||||||
|
RCN = (NRV, CCL)
|
||||||
|
QTM = (CKR, JPC)
|
||||||
|
JHT = (HRC, NVR)
|
||||||
|
KVB = (KRH, KKT)
|
||||||
|
HJG = (GHN, GHN)
|
||||||
|
RNF = (QFF, CKV)
|
||||||
|
PTT = (VNT, FNX)
|
||||||
|
GRB = (SVJ, KHH)
|
||||||
|
TRJ = (PVJ, QKP)
|
||||||
|
MHS = (FCV, JXD)
|
||||||
|
VBM = (SBN, DQF)
|
||||||
|
DLM = (VNH, SCJ)
|
||||||
|
PPJ = (DMH, PHJ)
|
||||||
|
QJN = (LSX, KBN)
|
||||||
|
HXV = (SMH, BJP)
|
||||||
|
GVL = (VMV, DKF)
|
||||||
|
QCG = (FKV, NVD)
|
||||||
|
FNM = (XRV, RKM)
|
||||||
|
JQJ = (NVT, HGR)
|
||||||
|
KVX = (GRG, PMJ)
|
||||||
|
JLV = (SMG, RPH)
|
||||||
|
TXD = (MFN, HQG)
|
||||||
|
TLJ = (FHD, MHN)
|
||||||
|
RPV = (GKH, BPT)
|
||||||
|
CPR = (JLH, PLC)
|
||||||
|
FLQ = (TPR, LGG)
|
||||||
|
BTF = (HGR, NVT)
|
||||||
|
GCH = (QPT, FDV)
|
||||||
|
JCF = (GHM, NKS)
|
||||||
|
CLF = (PCT, XKJ)
|
||||||
|
RMT = (QKM, XCP)
|
||||||
|
KPL = (DJB, VLV)
|
||||||
|
RMV = (NMS, HCC)
|
||||||
|
XRV = (VPH, PHH)
|
||||||
|
HBB = (XKH, FBQ)
|
||||||
|
PXB = (QBF, CLH)
|
||||||
|
HMR = (PCP, LMJ)
|
||||||
|
KCT = (PFS, PFB)
|
||||||
|
DCC = (MBP, BJC)
|
||||||
|
VFV = (VBD, HQS)
|
||||||
|
DJB = (BQX, SLD)
|
||||||
|
MFS = (VML, QHT)
|
||||||
|
RPC = (PHR, JFD)
|
||||||
|
RDS = (LFC, RNK)
|
||||||
|
KMC = (RPR, NRL)
|
||||||
|
CJD = (VJN, GKK)
|
||||||
|
VST = (VCS, CMQ)
|
||||||
|
VMC = (RPC, MCV)
|
||||||
|
VJV = (XTP, DRK)
|
||||||
|
BXH = (RXT, BLP)
|
||||||
|
PNQ = (DSF, PSH)
|
||||||
|
RJJ = (FXH, QLX)
|
||||||
|
NKS = (QDQ, DPP)
|
||||||
|
QDQ = (SJV, MRP)
|
||||||
|
HQQ = (CJD, DVT)
|
||||||
|
LKV = (CGQ, XNQ)
|
||||||
|
KTL = (HFF, FPS)
|
||||||
|
MBP = (RGB, SQK)
|
||||||
|
MQQ = (HCQ, MDL)
|
||||||
|
BQS = (SCJ, VNH)
|
||||||
|
NRT = (FJD, HTS)
|
||||||
|
HHG = (RTC, RPQ)
|
||||||
|
VNH = (XSD, HQH)
|
||||||
|
QTS = (QTG, MHD)
|
||||||
|
DJQ = (NRG, QCD)
|
||||||
|
MDX = (BPT, GKH)
|
||||||
|
QJV = (QQP, VLJ)
|
||||||
|
HBD = (HBB, CKC)
|
||||||
|
GBF = (HJG, FPV)
|
||||||
|
VDC = (JFJ, VNF)
|
||||||
|
MPH = (PFV, SHX)
|
||||||
|
TPR = (BXD, FVX)
|
||||||
|
KFX = (DJT, LLJ)
|
||||||
|
LSX = (VKN, STS)
|
||||||
|
HJL = (KFX, BBK)
|
||||||
|
QLT = (KGC, DMM)
|
||||||
|
QFF = (BJM, QCG)
|
||||||
|
DVM = (GCD, FSC)
|
||||||
|
MHD = (JCF, JPJ)
|
||||||
|
DPQ = (JJX, GNL)
|
||||||
|
NMS = (TRJ, RDN)
|
||||||
|
VLJ = (XJB, HSJ)
|
||||||
|
JSP = (MHN, FHD)
|
||||||
|
BTR = (GMD, TLD)
|
||||||
|
TTD = (SPC, DFJ)
|
||||||
|
QKT = (XPV, BVJ)
|
||||||
|
MKK = (HCQ, MDL)
|
||||||
|
LFC = (LSS, GQN)
|
||||||
|
QGL = (RPG, HGJ)
|
||||||
|
JDT = (FPN, DTC)
|
||||||
|
NCM = (RPG, HGJ)
|
||||||
|
LCN = (QLT, MTG)
|
||||||
|
VGS = (VJV, SRT)
|
||||||
|
CGF = (FXF, STT)
|
||||||
|
KQS = (PFB, PFS)
|
||||||
|
PFF = (DLD, MRJ)
|
||||||
|
LSH = (QTS, VRJ)
|
||||||
|
FGF = (MPH, SRJ)
|
||||||
|
BJG = (TVF, BDN)
|
||||||
|
HQR = (CXG, CPR)
|
||||||
|
JVF = (RGM, NCG)
|
||||||
|
SNP = (BLN, DFD)
|
||||||
|
DQH = (GSC, CFT)
|
||||||
|
JVA = (RMT, DPF)
|
||||||
|
VPH = (CRN, CHT)
|
||||||
|
DFQ = (VLF, TCJ)
|
||||||
|
DFD = (HQR, QDF)
|
||||||
|
NJH = (RXG, PFF)
|
||||||
|
DTK = (QLT, MTG)
|
||||||
|
MJJ = (DJH, RDQ)
|
||||||
|
GGB = (CFT, GSC)
|
||||||
|
SMH = (RHQ, RJX)
|
||||||
|
NFS = (SNP, QLP)
|
||||||
|
LNV = (XLR, KQF)
|
||||||
|
LCD = (FNM, XNT)
|
||||||
|
GQH = (JDT, JRX)
|
||||||
|
JPJ = (GHM, NKS)
|
||||||
|
GMD = (VFL, JLJ)
|
||||||
|
HTS = (KXR, KVB)
|
||||||
|
KFT = (LCD, QCL)
|
||||||
|
SGH = (NVR, HRC)
|
||||||
|
QKP = (MQD, MLM)
|
||||||
|
HFF = (MGM, KSX)
|
||||||
|
HJM = (KBN, LSX)
|
||||||
|
MJX = (VHC, PXF)
|
||||||
|
TSF = (FHB, DFQ)
|
||||||
|
MSH = (GFM, JHC)
|
||||||
|
VBG = (HJM, QJN)
|
||||||
|
CKS = (HCP, NVM)
|
||||||
|
DQF = (LJC, KXM)
|
||||||
|
FVP = (FJD, HTS)
|
||||||
|
DPP = (SJV, MRP)
|
||||||
|
FKM = (CSS, RBN)
|
||||||
|
VCD = (FCH, GBX)
|
||||||
|
DJV = (VMC, HVC)
|
||||||
|
RKM = (VPH, PHH)
|
||||||
|
TMP = (KHR, FGL)
|
||||||
|
BVC = (TLJ, JSP)
|
||||||
|
SRV = (HQS, VBD)
|
||||||
|
FCN = (DHM, VDX)
|
||||||
|
DJH = (FBG, MCQ)
|
||||||
|
NGG = (RPL, DFV)
|
||||||
|
SRT = (XTP, DRK)
|
||||||
|
RMN = (QTD, JGS)
|
||||||
|
MLH = (MQJ, VDR)
|
||||||
|
KVL = (VFV, SRV)
|
||||||
|
VDX = (FRV, HXV)
|
||||||
|
RXT = (LJB, XVK)
|
||||||
|
LSS = (RKT, NKK)
|
||||||
|
LNN = (KTB, QRV)
|
||||||
|
BCC = (CHL, QXP)
|
||||||
|
GHN = (XBS, XBS)
|
||||||
|
FCK = (FKM, BNR)
|
||||||
|
QLP = (BLN, DFD)
|
||||||
|
BDN = (JMC, MTV)
|
||||||
|
MLX = (VLJ, QQP)
|
||||||
|
RDH = (VNT, VNT)
|
||||||
|
DFV = (JKJ, KDX)
|
||||||
|
DXG = (JLV, MVL)
|
||||||
|
TCF = (DSF, PSH)
|
||||||
|
JJX = (MKM, TJJ)
|
||||||
|
VFL = (GGB, DQH)
|
||||||
|
VLV = (SLD, BQX)
|
||||||
|
RBQ = (JDT, JRX)
|
||||||
|
JXP = (QXB, QVT)
|
||||||
|
PFV = (STX, XHF)
|
||||||
|
BLN = (QDF, HQR)
|
||||||
|
FVX = (QKQ, MLL)
|
||||||
|
QTP = (DJV, GMN)
|
||||||
|
JLP = (NJF, MFR)
|
||||||
|
CXG = (PLC, JLH)
|
||||||
|
VKF = (JLX, SNS)
|
||||||
|
QQT = (GMN, DJV)
|
||||||
|
KDX = (MHH, PMX)
|
||||||
|
FJD = (KXR, KXR)
|
||||||
|
XJB = (PHB, JTH)
|
||||||
|
VMV = (RCN, XJS)
|
||||||
|
MKM = (HPG, QLV)
|
||||||
|
SQK = (GBF, JCS)
|
||||||
|
PMT = (SGQ, DXG)
|
||||||
|
LXQ = (GRB, TKB)
|
||||||
|
RKK = (SSK, SSK)
|
||||||
|
QXA = (VHC, PXF)
|
||||||
|
QDP = (QTD, JGS)
|
||||||
|
VQC = (KQF, XLR)
|
||||||
|
QKQ = (PPJ, NHV)
|
||||||
|
TXM = (JLP, JCJ)
|
||||||
|
SPC = (LRR, SXC)
|
||||||
|
BHG = (KFL, BCC)
|
||||||
|
QBK = (VNF, JFJ)
|
||||||
|
BPB = (LBJ, JGT)
|
||||||
|
RNK = (LSS, GQN)
|
||||||
|
BJP = (RHQ, RJX)
|
||||||
|
VNT = (MJX, MJX)
|
||||||
|
QLX = (GCH, KBD)
|
||||||
|
DXF = (RNH, RNH)
|
||||||
|
DLS = (VFV, SRV)
|
||||||
|
SXR = (TLJ, JSP)
|
||||||
|
SGQ = (JLV, MVL)
|
||||||
|
NRL = (XPP, XGM)
|
||||||
|
JFD = (LVD, LTQ)
|
||||||
|
XNM = (JXF, LVT)
|
||||||
|
PHH = (CHT, CRN)
|
||||||
|
QTD = (CTJ, LPF)
|
||||||
|
FCV = (GTC, CKJ)
|
||||||
|
QRG = (JLP, JCJ)
|
||||||
|
DKS = (KPL, KTR)
|
||||||
|
TTQ = (BFV, LVR)
|
||||||
|
RPR = (XGM, XPP)
|
||||||
|
DVS = (FTH, FFG)
|
||||||
|
RRH = (NJH, QDN)
|
||||||
|
KTR = (DJB, VLV)
|
||||||
|
KQM = (BJV, MND)
|
||||||
|
GKS = (BXH, QCZ)
|
||||||
|
FSV = (MPS, NRB)
|
||||||
|
QXB = (DJQ, JCK)
|
||||||
|
FHX = (QFS, TSF)
|
||||||
|
FGL = (QGL, NCM)
|
||||||
|
BHB = (KCN, NGH)
|
||||||
|
KNA = (KTV, KPG)
|
||||||
|
NBN = (LPH, XFB)
|
||||||
|
NVM = (NVL, MPV)
|
||||||
|
LVR = (CNB, FGX)
|
||||||
|
QCL = (FNM, XNT)
|
||||||
|
XRR = (MTB, HMR)
|
||||||
|
LLS = (TXM, QRG)
|
||||||
|
AAA = (MJJ, QBJ)
|
||||||
|
RPL = (JKJ, KDX)
|
||||||
|
QCM = (QVT, QXB)
|
||||||
|
QVF = (BQS, DLM)
|
||||||
|
LMQ = (LMK, BVF)
|
||||||
|
BLS = (CQK, GTG)
|
||||||
|
JMC = (PLP, HJL)
|
||||||
|
KXM = (RNF, FNK)
|
||||||
|
NDH = (FHJ, GML)
|
||||||
|
SNS = (VJK, FMJ)
|
||||||
|
KFL = (QXP, CHL)
|
||||||
|
FSD = (XNH, MJF)
|
||||||
|
DTC = (GLD, TCK)
|
||||||
|
MRP = (CGF, VKD)
|
||||||
|
JHX = (CJD, DVT)
|
||||||
|
KPG = (LKK, VGH)
|
||||||
|
DJT = (NVX, BTR)
|
||||||
|
MQD = (FQT, KDB)
|
||||||
|
CKJ = (BLS, CGP)
|
||||||
|
JXD = (GTC, CKJ)
|
||||||
|
NVL = (CGR, TSC)
|
||||||
|
PKV = (DBR, PGB)
|
||||||
|
JPL = (QLB, RQT)
|
||||||
|
TSC = (FMS, KRS)
|
||||||
|
XGL = (GML, FHJ)
|
||||||
|
DJD = (PBL, CMM)
|
||||||
|
FSC = (BFG, NTH)
|
||||||
|
DMH = (PBN, HND)
|
||||||
|
KRS = (FQR, PXB)
|
||||||
|
LLM = (GMX, VLX)
|
||||||
|
FJB = (XQV, KFT)
|
||||||
|
KRH = (QHR, QHR)
|
||||||
|
RDQ = (MCQ, FBG)
|
||||||
|
GLD = (VST, JPF)
|
||||||
|
RVP = (HBD, RBC)
|
||||||
|
DHV = (RJJ, KFV)
|
||||||
|
FMX = (RFL, GSG)
|
||||||
|
SMX = (DBX, QTF)
|
||||||
|
LPP = (FSD, PHM)
|
||||||
|
TDG = (MKK, MQQ)
|
||||||
|
HPL = (BDN, TVF)
|
||||||
|
MGM = (RDH, RDH)
|
||||||
|
FHJ = (XFJ, GVL)
|
||||||
|
TQB = (VFP, VGF)
|
||||||
|
JLJ = (DQH, GGB)
|
||||||
|
FMS = (FQR, PXB)
|
||||||
|
HQD = (BPR, SJK)
|
||||||
|
VXR = (XQX, VBG)
|
||||||
|
GML = (XFJ, GVL)
|
||||||
|
GCS = (RKJ, CSC)
|
||||||
|
CTJ = (SRD, BHH)
|
||||||
|
CLH = (XHQ, VKF)
|
||||||
|
HND = (RDL, PXS)
|
||||||
|
QPT = (RRH, CKQ)
|
||||||
|
NVD = (HKK, JVF)
|
||||||
|
XGM = (VFK, MLH)
|
||||||
|
GMN = (HVC, VMC)
|
||||||
|
QDF = (CXG, CPR)
|
||||||
|
TCK = (JPF, VST)
|
||||||
|
BJH = (LSL, BHB)
|
||||||
|
JNC = (BPB, SLZ)
|
||||||
|
GSC = (QVF, MJM)
|
||||||
|
XHG = (SRJ, MPH)
|
||||||
|
CGQ = (GTJ, LXQ)
|
||||||
|
CHL = (TGV, HPX)
|
||||||
|
MRJ = (LDK, SSQ)
|
||||||
|
GKH = (VQC, LNV)
|
||||||
|
MLM = (FQT, KDB)
|
||||||
|
BPT = (LNV, VQC)
|
||||||
|
BXT = (TKD, ZZZ)
|
||||||
|
PMP = (NHP, KJP)
|
||||||
|
PLC = (XLV, CKG)
|
||||||
|
FXA = (LBJ, JGT)
|
||||||
|
PKP = (RFL, GSG)
|
||||||
|
BQX = (MSH, NSN)
|
||||||
|
LBJ = (SFN, GQT)
|
||||||
|
KMD = (KFV, RJJ)
|
||||||
|
PVJ = (MQD, MLM)
|
||||||
|
LDQ = (LVR, BFV)
|
||||||
|
SLS = (PGB, DBR)
|
||||||
|
VTP = (HQQ, JHX)
|
||||||
|
MPS = (QTX, DGF)
|
||||||
|
VRJ = (QTG, MHD)
|
||||||
|
HBH = (HNG, FKF)
|
||||||
|
RTC = (RMD, FJB)
|
||||||
|
PHB = (LPD, LPD)
|
||||||
|
CMM = (DMS, KFB)
|
||||||
|
QVR = (MKK, MQQ)
|
||||||
|
XFJ = (DKF, VMV)
|
||||||
|
TLV = (DLN, LLS)
|
||||||
|
QRV = (SCL, BSJ)
|
||||||
|
MFN = (GHK, RRL)
|
||||||
|
NVT = (LFX, PVX)
|
||||||
|
FVL = (HMR, MTB)
|
||||||
|
VCS = (TQB, BBM)
|
||||||
|
XHF = (QBK, VDC)
|
||||||
|
JTV = (FSD, PHM)
|
||||||
|
VML = (TTD, LBH)
|
||||||
|
SCL = (DKS, TJH)
|
||||||
|
VHC = (QXM, HDF)
|
||||||
|
LPV = (GMX, VLX)
|
||||||
|
CFG = (BTF, JQJ)
|
||||||
|
MCV = (PHR, JFD)
|
||||||
|
LDS = (FGF, XHG)
|
||||||
|
VGF = (QCM, JXP)
|
||||||
|
BVF = (QQT, QTP)
|
||||||
|
VKN = (TMP, BSB)
|
||||||
|
VJK = (KQM, DHQ)
|
||||||
|
CTK = (GSF, HQN)
|
||||||
|
PHM = (MJF, XNH)
|
||||||
|
PVX = (MHK, SXL)
|
||||||
|
JPC = (KQH, HQD)
|
||||||
|
JGS = (CTJ, LPF)
|
||||||
|
XNV = (CLR, BLB)
|
||||||
|
PTS = (KCT, KQS)
|
||||||
|
BXS = (BVF, LMK)
|
||||||
|
BJB = (XPV, BVJ)
|
||||||
|
MHK = (VTP, KKX)
|
||||||
|
CJC = (NMS, HCC)
|
||||||
|
RKT = (PMT, FCX)
|
||||||
|
BFG = (QQV, MHS)
|
||||||
|
LPH = (HDD, DVM)
|
||||||
|
GSR = (GLN, NQG)
|
||||||
|
MHH = (VGS, TRH)
|
||||||
|
HMT = (BLB, CLR)
|
||||||
|
JCJ = (NJF, MFR)
|
||||||
|
MDK = (RPV, MDX)
|
||||||
|
LRR = (DPQ, XTB)
|
||||||
|
RKJ = (PDP, BLD)
|
||||||
|
MJF = (RXX, SGS)
|
||||||
|
NCG = (NRT, FVP)
|
||||||
|
QQV = (JXD, FCV)
|
||||||
|
MJQ = (BCC, KFL)
|
||||||
|
TKD = (MJJ, QBJ)
|
||||||
|
MND = (MDK, KBG)
|
||||||
|
RXG = (MRJ, DLD)
|
||||||
|
BGT = (DHM, VDX)
|
||||||
|
XCP = (LPP, JTV)
|
||||||
|
TRS = (QPH, GCS)
|
||||||
|
FPS = (MGM, KSX)
|
||||||
|
MVL = (SMG, RPH)
|
||||||
|
BJM = (NVD, FKV)
|
||||||
|
BSJ = (TJH, DKS)
|
||||||
|
MTV = (PLP, HJL)
|
||||||
|
GQC = (FTV, DJD)
|
||||||
|
CQL = (FTK, MQF)
|
||||||
|
VQM = (RMV, CJC)
|
||||||
|
SLZ = (JGT, LBJ)
|
||||||
|
HVC = (MCV, RPC)
|
||||||
|
LFX = (MHK, SXL)
|
||||||
|
BJQ = (LFC, RNK)
|
||||||
|
BFV = (FGX, CNB)
|
||||||
|
DRK = (HMT, XNV)
|
||||||
|
VBD = (NKP, FRN)
|
||||||
|
KBN = (STS, VKN)
|
||||||
|
XQX = (HJM, QJN)
|
||||||
|
MPR = (HQG, MFN)
|
||||||
|
KFB = (MFS, QVD)
|
||||||
|
GHM = (QDQ, DPP)
|
||||||
|
KBD = (QPT, FDV)
|
||||||
|
MVH = (FVL, XRR)
|
||||||
|
PGB = (RVG, TRS)
|
||||||
|
RGM = (NRT, FVP)
|
||||||
|
KKT = (QHR, GNZ)
|
||||||
|
TCJ = (RDS, BJQ)
|
||||||
|
MVQ = (HBD, RBC)
|
||||||
|
CKC = (XKH, FBQ)
|
||||||
|
SHX = (XHF, STX)
|
||||||
|
NVR = (RFF, GRH)
|
||||||
|
DKF = (RCN, XJS)
|
||||||
|
KTB = (BSJ, SCL)
|
||||||
|
HSJ = (PHB, JTH)
|
||||||
|
RJH = (DCC, CCH)
|
||||||
|
FNK = (QFF, CKV)
|
||||||
|
XNH = (SGS, RXX)
|
||||||
|
NRV = (DXF, DXF)
|
||||||
|
HRM = (RNH, GKS)
|
||||||
|
LJL = (GBX, FCH)
|
||||||
|
RDN = (PVJ, QKP)
|
||||||
|
JXM = (MVQ, RVP)
|
||||||
|
XLR = (HBH, MGJ)
|
||||||
|
QXP = (HPX, TGV)
|
||||||
|
HQH = (TTQ, LDQ)
|
||||||
|
HGJ = (FCK, HGS)
|
||||||
|
JTH = (LPD, DDK)
|
||||||
|
NKK = (FCX, PMT)
|
||||||
|
DHQ = (MND, BJV)
|
||||||
|
RFF = (FLV, QLQ)
|
||||||
|
RGB = (GBF, JCS)
|
||||||
|
RMX = (DFV, RPL)
|
||||||
|
VXF = (XRR, FVL)
|
||||||
|
SMG = (RSN, VBM)
|
||||||
|
KBG = (RPV, MDX)
|
||||||
|
QCZ = (BLP, RXT)
|
||||||
|
CQK = (BJG, HPL)
|
||||||
|
FDV = (RRH, CKQ)
|
||||||
|
CKQ = (QDN, NJH)
|
||||||
|
RRL = (JMM, VBN)
|
||||||
|
RVG = (QPH, GCS)
|
||||||
|
FTT = (GRG, PMJ)
|
||||||
|
FHD = (KMD, DHV)
|
||||||
|
GFM = (MRG, CDX)
|
||||||
|
FFG = (QRK, FHX)
|
||||||
|
RTG = (GSF, HQN)
|
||||||
|
PXS = (MLX, QJV)
|
||||||
|
MQJ = (JHT, SGH)
|
||||||
|
KSX = (RDH, PTT)
|
||||||
|
VXP = (VBG, XQX)
|
||||||
|
PMX = (TRH, VGS)
|
||||||
|
BPR = (GRQ, JXM)
|
||||||
|
VKD = (STT, FXF)
|
||||||
|
SXL = (KKX, VTP)
|
||||||
|
HDD = (GCD, FSC)
|
||||||
|
GTJ = (GRB, TKB)
|
||||||
|
CHT = (VXP, VXR)
|
||||||
|
RBC = (CKC, HBB)
|
||||||
|
XBS = (TKD, TKD)
|
||||||
|
KHH = (CQL, HQF)
|
||||||
|
XTX = (TPR, LGG)
|
||||||
|
LKK = (LLM, LPV)
|
||||||
|
VFK = (VDR, MQJ)
|
||||||
|
JLX = (VJK, FMJ)
|
||||||
|
FRV = (SMH, BJP)
|
||||||
|
GTC = (CGP, BLS)
|
||||||
|
PHR = (LTQ, LVD)
|
||||||
|
GCD = (BFG, NTH)
|
||||||
|
SBN = (KXM, LJC)
|
||||||
|
STX = (QBK, VDC)
|
||||||
|
FBG = (RTG, CTK)
|
||||||
|
CKV = (BJM, QCG)
|
||||||
|
DPF = (XCP, QKM)
|
||||||
|
FKF = (MVH, VXF)
|
||||||
|
BLB = (PGK, NFS)
|
||||||
|
XPV = (MJQ, BHG)
|
||||||
|
GMX = (FTT, KVX)
|
||||||
|
LBH = (DFJ, SPC)
|
||||||
|
JHC = (CDX, MRG)
|
||||||
|
GNL = (TJJ, MKM)
|
||||||
|
DSM = (FTH, FFG)
|
||||||
|
FFT = (QGN, LRB)
|
||||||
|
GRG = (NPJ, LNN)
|
||||||
|
JFJ = (HHG, LVQ)
|
||||||
|
CGR = (FMS, KRS)
|
||||||
|
LFS = (XTX, FLQ)
|
||||||
|
DMF = (TCF, PNQ)
|
||||||
|
LVQ = (RTC, RPQ)
|
||||||
|
DFJ = (SXC, LRR)
|
||||||
|
VLF = (RDS, BJQ)
|
||||||
|
LMJ = (BPL, XSF)
|
||||||
|
BVJ = (BHG, MJQ)
|
||||||
|
NRB = (QTX, DGF)
|
||||||
|
GKK = (RMN, QDP)
|
||||||
|
CFD = (PNQ, TCF)
|
||||||
|
GBX = (DSM, DVS)
|
||||||
|
NTM = (BPB, BPB)
|
||||||
|
XKH = (GHJ, FSV)
|
||||||
|
LGG = (BXD, FVX)
|
||||||
|
DBR = (RVG, TRS)
|
||||||
|
GTG = (BJG, HPL)
|
||||||
|
HKK = (NCG, RGM)
|
||||||
|
CKG = (LKV, QNK)
|
||||||
|
FKG = (RMT, DPF)
|
||||||
|
QVQ = (DKD, QTM)
|
||||||
|
LDK = (KTL, JMR)
|
||||||
|
PHJ = (PBN, HND)
|
||||||
|
PFZ = (PXF, VHC)
|
||||||
|
VLX = (KVX, FTT)
|
||||||
|
KQF = (HBH, MGJ)
|
||||||
|
RQN = (SSK, PMP)
|
||||||
|
CMQ = (TQB, BBM)
|
||||||
|
NHP = (FKG, FKG)
|
||||||
|
DVT = (GKK, VJN)
|
||||||
|
RPG = (FCK, HGS)
|
||||||
|
RBN = (RKK, RQN)
|
||||||
|
PBN = (RDL, PXS)
|
||||||
|
RCH = (QTM, DKD)
|
||||||
|
CRN = (VXP, VXR)
|
||||||
|
TNN = (KBF, TDV)
|
||||||
|
RFL = (QJP, CLF)
|
||||||
|
NJF = (DMF, CFD)
|
||||||
|
NQG = (RMX, NGG)
|
||||||
|
VDR = (JHT, SGH)
|
||||||
|
FPV = (GHN, BRB)
|
||||||
|
PBL = (DMS, KFB)
|
||||||
|
XTB = (JJX, GNL)
|
||||||
|
HGS = (FKM, BNR)
|
||||||
|
CCH = (BJC, MBP)
|
||||||
|
STT = (LMQ, BXS)
|
||||||
|
LTQ = (SLS, PKV)
|
||||||
|
SFN = (LCN, DTK)
|
||||||
|
NGH = (QVR, TDG)
|
||||||
|
RQK = (RPR, NRL)
|
||||||
|
PDP = (NDH, XGL)
|
||||||
|
FCH = (DSM, DVS)
|
||||||
|
QCD = (SCH, LDS)
|
||||||
|
TKF = (BTF, JQJ)
|
||||||
|
BPL = (BGT, FCN)
|
||||||
|
SVJ = (CQL, HQF)
|
||||||
|
QTG = (JPJ, JCF)
|
||||||
|
NSN = (GFM, JHC)
|
||||||
|
JCS = (HJG, FPV)
|
||||||
|
HRC = (GRH, RFF)
|
||||||
|
VGH = (LLM, LPV)
|
||||||
|
BRB = (XBS, BXT)
|
||||||
|
JMR = (HFF, FPS)
|
||||||
|
VJN = (RMN, QDP)
|
||||||
|
HPX = (TKF, CFG)
|
||||||
|
CFT = (QVF, MJM)
|
||||||
|
DBX = (KVL, DLS)
|
||||||
|
NHV = (PHJ, DMH)
|
||||||
|
FTH = (QRK, FHX)
|
||||||
|
XFB = (DVM, HDD)
|
||||||
|
XPP = (MLH, VFK)
|
||||||
|
CGP = (CQK, GTG)
|
||||||
|
MDL = (FFT, CBC)
|
||||||
|
GNZ = (KPG, KTV)
|
||||||
|
BJV = (KBG, MDK)
|
||||||
|
SCH = (FGF, XHG)
|
||||||
|
RXX = (KMC, RQK)
|
||||||
|
HQG = (GHK, RRL)
|
||||||
|
KKX = (JHX, HQQ)
|
||||||
|
LVD = (SLS, PKV)
|
||||||
|
QQP = (XJB, HSJ)
|
||||||
|
MTB = (LMJ, PCP)
|
||||||
|
FMJ = (KQM, DHQ)
|
||||||
@@ -3,4 +3,75 @@ import os
|
|||||||
with open(r'advent_of_code\2023\day_8\input.txt', 'r') as file:
|
with open(r'advent_of_code\2023\day_8\input.txt', 'r') as file:
|
||||||
input = file.read()
|
input = file.read()
|
||||||
|
|
||||||
print(input)
|
#print(input)
|
||||||
|
|
||||||
|
# test_input = '''RL
|
||||||
|
# AAA = (BBB, CCC)
|
||||||
|
# BBB = (DDD, EEE)
|
||||||
|
# CCC = (ZZZ, GGG)
|
||||||
|
# DDD = (DDD, DDD)
|
||||||
|
# EEE = (EEE, EEE)
|
||||||
|
# GGG = (GGG, GGG)
|
||||||
|
# ZZZ = (ZZZ, ZZZ)'''
|
||||||
|
|
||||||
|
test_input = '''LLR
|
||||||
|
AAA = (BBB, BBB)
|
||||||
|
BBB = (AAA, ZZZ)
|
||||||
|
ZZZ = (ZZZ, ZZZ)'''
|
||||||
|
|
||||||
|
input = input.split('\n')
|
||||||
|
|
||||||
|
top_line = input[0]
|
||||||
|
#print(top_line)
|
||||||
|
# change L to 0 and R to 1 and split into list
|
||||||
|
top_line = list(top_line)
|
||||||
|
top_line = [s.replace('L', '0').replace('R', '1') for s in top_line]
|
||||||
|
#print(top_line)
|
||||||
|
|
||||||
|
# create a dictionary of instructions, where is the key is a range of numbers and the value is a number from the top line
|
||||||
|
instructions = {}
|
||||||
|
for i in range(0, len(top_line)):
|
||||||
|
instructions[i] = top_line[i]
|
||||||
|
|
||||||
|
#print(instructions)
|
||||||
|
|
||||||
|
# now we need to take the rest of the input and and split it into a dictionary where the key is left of the = sign
|
||||||
|
# and the value is a list of the right of the = sign split by commas and stripped of whitespace and brackets
|
||||||
|
|
||||||
|
guide = input[1:]
|
||||||
|
#print(guide)
|
||||||
|
if guide[0] == '':
|
||||||
|
guide.pop(0)
|
||||||
|
for i in range(0, len(guide)):
|
||||||
|
if '=' in guide[i]:
|
||||||
|
guide[i] = guide[i].replace(' ', '').replace('(', '').replace(')', '').split('=')
|
||||||
|
guide[i][1] = guide[i][1].split(',')
|
||||||
|
guide[i][1] = [x.strip() for x in guide[i][1]]
|
||||||
|
|
||||||
|
# now we need to create a dictionary where the key is the left of the = sign and the value is a list of the right of the = sign split by commas and stripped of whitespace and brackets
|
||||||
|
guide_dict = {}
|
||||||
|
for i in range(0, len(guide)):
|
||||||
|
guide_dict[guide[i][0]] = guide[i][1]
|
||||||
|
|
||||||
|
print(guide_dict)
|
||||||
|
|
||||||
|
# starting at 'AAA' we need to follow the instructions to get to the bottom of the tree
|
||||||
|
# we need to follow the instructions until we get to ZZZ
|
||||||
|
# if we run out of instructions before we get to ZZZ then we need to repeat the instructions from where we are
|
||||||
|
# Convert the dictionary to a list
|
||||||
|
|
||||||
|
|
||||||
|
# Perform the operation
|
||||||
|
|
||||||
|
current_node = 'AAA'
|
||||||
|
step = 0
|
||||||
|
while current_node != 'ZZZ':
|
||||||
|
print(current_node)
|
||||||
|
# Use modulo to wrap step around if it's greater than the length of instructions
|
||||||
|
choose_items = int(instructions[step % len(instructions)])
|
||||||
|
next_node = guide_dict[current_node][choose_items]
|
||||||
|
current_node = next_node
|
||||||
|
step += 1
|
||||||
|
|
||||||
|
print(f'finished in {step} steps, current node is {current_node}')
|
||||||
|
print(current_node)
|
||||||
|
|||||||
@@ -3,4 +3,80 @@ import os
|
|||||||
with open(r'advent_of_code\2023\day_8\input.txt', 'r') as file:
|
with open(r'advent_of_code\2023\day_8\input.txt', 'r') as file:
|
||||||
input = file.read()
|
input = file.read()
|
||||||
|
|
||||||
print(input)
|
#print(input)
|
||||||
|
|
||||||
|
test_input = '''LR
|
||||||
|
11A = (11B, XXX)
|
||||||
|
11B = (XXX, 11Z)
|
||||||
|
11Z = (11B, XXX)
|
||||||
|
22A = (22B, XXX)
|
||||||
|
22B = (22C, 22C)
|
||||||
|
22C = (22Z, 22Z)
|
||||||
|
22Z = (22B, 22B)
|
||||||
|
XXX = (XXX, XXX)'''
|
||||||
|
|
||||||
|
#test_input = '''LLR
|
||||||
|
#AAA = (BBB, BBB)
|
||||||
|
#BBB = (AAA, ZZZ)
|
||||||
|
#ZZZ = (ZZZ, ZZZ)'''
|
||||||
|
|
||||||
|
input = input.split('\n')
|
||||||
|
#input = test_input.split('\n')
|
||||||
|
|
||||||
|
top_line = input[0]
|
||||||
|
#print(top_line)
|
||||||
|
# change L to 0 and R to 1 and split into list
|
||||||
|
top_line = list(top_line)
|
||||||
|
top_line = [s.replace('L', '0').replace('R', '1') for s in top_line]
|
||||||
|
#print(top_line)
|
||||||
|
|
||||||
|
# create a dictionary of instructions, where is the key is a range of numbers and the value is a number from the top line
|
||||||
|
instructions = {}
|
||||||
|
for i in range(0, len(top_line)):
|
||||||
|
instructions[i] = top_line[i]
|
||||||
|
|
||||||
|
#print(instructions)
|
||||||
|
|
||||||
|
# now we need to take the rest of the input and and split it into a dictionary where the key is left of the = sign
|
||||||
|
# and the value is a list of the right of the = sign split by commas and stripped of whitespace and brackets
|
||||||
|
|
||||||
|
guide = input[1:]
|
||||||
|
#print(guide)
|
||||||
|
if guide[0] == '':
|
||||||
|
guide.pop(0)
|
||||||
|
for i in range(0, len(guide)):
|
||||||
|
if '=' in guide[i]:
|
||||||
|
guide[i] = guide[i].replace(' ', '').replace('(', '').replace(')', '').split('=')
|
||||||
|
guide[i][1] = guide[i][1].split(',')
|
||||||
|
guide[i][1] = [x.strip() for x in guide[i][1]]
|
||||||
|
|
||||||
|
# now we need to create a dictionary where the key is the left of the = sign and the value is a list of the right of the = sign split by commas and stripped of whitespace and brackets
|
||||||
|
guide_dict = {}
|
||||||
|
for i in range(0, len(guide)):
|
||||||
|
guide_dict[guide[i][0]] = guide[i][1]
|
||||||
|
|
||||||
|
print(guide_dict)
|
||||||
|
|
||||||
|
# starting at 'AAA' we need to follow the instructions to get to the bottom of the tree
|
||||||
|
# we need to follow the instructions until we get to ZZZ
|
||||||
|
# if we run out of instructions before we get to ZZZ then we need to repeat the instructions from where we are
|
||||||
|
# Convert the dictionary to a list
|
||||||
|
|
||||||
|
|
||||||
|
# Perform the operation
|
||||||
|
|
||||||
|
# Initialize current_nodes as a list of starting nodes
|
||||||
|
current_nodes = [node for node in guide_dict.keys() if node.endswith('A')]
|
||||||
|
|
||||||
|
step = 0
|
||||||
|
while not all(node.endswith('Z') for node in current_nodes):
|
||||||
|
#print(current_nodes)
|
||||||
|
print(step)
|
||||||
|
# Use modulo to wrap step around if it's greater than the length of instructions
|
||||||
|
choose_items = int(instructions[step % len(instructions)])
|
||||||
|
# Update each node in the list
|
||||||
|
current_nodes = [guide_dict[node][choose_items] for node in current_nodes]
|
||||||
|
step += 1
|
||||||
|
|
||||||
|
print(f'finished in {step} steps, current nodes are {current_nodes}')
|
||||||
|
print(current_nodes)
|
||||||
@@ -1 +1,53 @@
|
|||||||
# Day 8 Puzzle Text.
|
|
||||||
|
<article class="day-desc"><h2>--- Day 8: Haunted Wasteland ---</h2><p>You're still riding a camel across Desert Island when you spot a sandstorm quickly approaching. When you turn to warn the Elf, she disappears before your eyes! To be fair, she had just finished warning you about <em>ghosts</em> a few minutes ago.</p>
|
||||||
|
<p>One of the camel's pouches is labeled "maps" - sure enough, it's full of documents (your puzzle input) about how to navigate the desert. At least, you're pretty sure that's what they are; one of the documents contains a list of left/right instructions, and the rest of the documents seem to describe some kind of <em>network</em> of labeled nodes.</p>
|
||||||
|
<p>It seems like you're meant to use the <em>left/right</em> instructions to <em>navigate the network</em>. Perhaps if you have the camel follow the same instructions, you can escape the haunted wasteland!</p>
|
||||||
|
<p>After examining the maps for a bit, two nodes stick out: <code>AAA</code> and <code>ZZZ</code>. You feel like <code>AAA</code> is where you are now, and you have to follow the left/right instructions until you reach <code>ZZZ</code>.</p>
|
||||||
|
<p>This format defines each <em>node</em> of the network individually. For example:</p>
|
||||||
|
<pre><code>RL
|
||||||
|
|
||||||
|
AAA = (BBB, CCC)
|
||||||
|
BBB = (DDD, EEE)
|
||||||
|
CCC = (ZZZ, GGG)
|
||||||
|
DDD = (DDD, DDD)
|
||||||
|
EEE = (EEE, EEE)
|
||||||
|
GGG = (GGG, GGG)
|
||||||
|
ZZZ = (ZZZ, ZZZ)
|
||||||
|
</code></pre>
|
||||||
|
<p>Starting with <code>AAA</code>, you need to <em>look up the next element</em> based on the next left/right instruction in your input. In this example, start with <code>AAA</code> and go <em>right</em> (<code>R</code>) by choosing the right element of <code>AAA</code>, <code><em>CCC</em></code>. Then, <code>L</code> means to choose the <em>left</em> element of <code>CCC</code>, <code><em>ZZZ</em></code>. By following the left/right instructions, you reach <code>ZZZ</code> in <code><em>2</em></code> steps.</p>
|
||||||
|
<p>Of course, you might not find <code>ZZZ</code> right away. If you run out of left/right instructions, repeat the whole sequence of instructions as necessary: <code>RL</code> really means <code>RLRLRLRLRLRLRLRL...</code> and so on. For example, here is a situation that takes <code><em>6</em></code> steps to reach <code>ZZZ</code>:</p>
|
||||||
|
<pre><code>LLR
|
||||||
|
|
||||||
|
AAA = (BBB, BBB)
|
||||||
|
BBB = (AAA, ZZZ)
|
||||||
|
ZZZ = (ZZZ, ZZZ)
|
||||||
|
</code></pre>
|
||||||
|
<p>Starting at <code>AAA</code>, follow the left/right instructions. <em>How many steps are required to reach <code>ZZZ</code>?</em></p>
|
||||||
|
|
||||||
|
<article class="day-desc"><h2 id="part2">--- Part Two ---</h2><p>The <span title="Duhduhduhduhduh! Dah, duhduhduhduhduh!">sandstorm</span> is upon you and you aren't any closer to escaping the wasteland. You had the camel follow the instructions, but you've barely left your starting position. It's going to take <em>significantly more steps</em> to escape!</p>
|
||||||
|
<p>What if the map isn't for people - what if the map is for <em>ghosts</em>? Are ghosts even bound by the laws of spacetime? Only one way to find out.</p>
|
||||||
|
<p>After examining the maps a bit longer, your attention is drawn to a curious fact: the number of nodes with names ending in <code>A</code> is equal to the number ending in <code>Z</code>! If you were a ghost, you'd probably just <em>start at every node that ends with <code>A</code></em> and follow all of the paths at the same time until they all simultaneously end up at nodes that end with <code>Z</code>.</p>
|
||||||
|
<p>For example:</p>
|
||||||
|
<pre><code>LR
|
||||||
|
|
||||||
|
11A = (11B, XXX)
|
||||||
|
11B = (XXX, 11Z)
|
||||||
|
11Z = (11B, XXX)
|
||||||
|
22A = (22B, XXX)
|
||||||
|
22B = (22C, 22C)
|
||||||
|
22C = (22Z, 22Z)
|
||||||
|
22Z = (22B, 22B)
|
||||||
|
XXX = (XXX, XXX)
|
||||||
|
</code></pre>
|
||||||
|
<p>Here, there are two starting nodes, <code>11A</code> and <code>22A</code> (because they both end with <code>A</code>). As you follow each left/right instruction, use that instruction to <em>simultaneously</em> navigate away from both nodes you're currently on. Repeat this process until <em>all</em> of the nodes you're currently on end with <code>Z</code>. (If only some of the nodes you're on end with <code>Z</code>, they act like any other node and you continue as normal.) In this example, you would proceed as follows:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Step 0: You are at <code>11A</code> and <code>22A</code>.</li>
|
||||||
|
<li>Step 1: You choose all of the <em>left</em> paths, leading you to <code>11B</code> and <code>22B</code>.</li>
|
||||||
|
<li>Step 2: You choose all of the <em>right</em> paths, leading you to <code><em>11Z</em></code> and <code>22C</code>.</li>
|
||||||
|
<li>Step 3: You choose all of the <em>left</em> paths, leading you to <code>11B</code> and <code><em>22Z</em></code>.</li>
|
||||||
|
<li>Step 4: You choose all of the <em>right</em> paths, leading you to <code><em>11Z</em></code> and <code>22B</code>.</li>
|
||||||
|
<li>Step 5: You choose all of the <em>left</em> paths, leading you to <code>11B</code> and <code>22C</code>.</li>
|
||||||
|
<li>Step 6: You choose all of the <em>right</em> paths, leading you to <code><em>11Z</em></code> and <code><em>22Z</em></code>.</li>
|
||||||
|
</ul>
|
||||||
|
<p>So, in this example, you end up entirely on nodes that end in <code>Z</code> after <code><em>6</em></code> steps.</p>
|
||||||
|
<p>Simultaneously start on every node that ends with <code>A</code>. <em>How many steps does it take before you're only on nodes that end with <code>Z</code>?</em></p>
|
||||||
+1
-1
@@ -57,6 +57,6 @@ def populate_data(year = current_year, day=current_day):
|
|||||||
None
|
None
|
||||||
"""
|
"""
|
||||||
save_puzzle_text(year, day)
|
save_puzzle_text(year, day)
|
||||||
#save_puzzle_input(year, day)
|
save_puzzle_input(year, day)
|
||||||
|
|
||||||
populate_data()
|
populate_data()
|
||||||
Reference in New Issue
Block a user