From d325ab6752b37294ce62918c797ff30084bcf0b4 Mon Sep 17 00:00:00 2001 From: j-james Date: Wed, 1 Dec 2021 10:24:59 -0800 Subject: Day Two (2018) --- 2018/02.py | 28 ++++++ 2018/input/02.txt | 250 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 278 insertions(+) create mode 100644 2018/02.py create mode 100644 2018/input/02.txt (limited to '2018') diff --git a/2018/02.py b/2018/02.py new file mode 100644 index 0000000..6a80540 --- /dev/null +++ b/2018/02.py @@ -0,0 +1,28 @@ +# Day Two: Inventory Management System + +file = open("input/02.txt").readlines() + +twice: int = 0 +thrice: int = 0 +for line in file: + for char in "abcdefghijklmnopqrstuvwxyz": + if line.count(char) == 2: + twice += 1 + break + for char in "abcdefghijklmnopqrstuvwxyz": + if line.count(char) == 3: + thrice += 1 + break +print(twice * thrice) + +for one in file: + for two in file: + differing = 0 + for i in range(len(one)): + if one[i] != two[i]: + differing += 1 + if differing == 1: + for i in range(len(one)): + if one[i] == two[i]: + print(one[i], end="") + quit() diff --git a/2018/input/02.txt b/2018/input/02.txt new file mode 100644 index 0000000..5afe3c6 --- /dev/null +++ b/2018/input/02.txt @@ -0,0 +1,250 @@ +jplenqtlagxhivmwmscfukzodp +jbrehqtlagxhivmeyscfuvzodp +jbreaqtlagxzivmwysofukzodp +jxrgnqtlagxhivmwyscfukwodp +jbrenqtwagjhivmwysxfukzodp +jbrenqplagxhivmwyscfuazoip +jbrenqtlagxhivzwyscfldzodp +jbrefqtlagxhizmwyfcfukzodp +jbrenqtlagxhevmwfsafukzodp +jbrunqtlagxrivmsyscfukzodp +jbrenqtlaguhivmwyhlfukzodp +jbrcnstsagxhivmwyscfukzodp +jbrenqtlagozivmwyscbukzodp +jbrenqwlagxhivswysrfukzodp +jbrenstlagxhuvmiyscfukzodp +jbranqtlhgxhivmwysnfukzodp +jbrenqtvagxhinmxyscfukzodp +jbrenqtlagdhivmwyscfukxody +jbrenqtlagelavmwyscfukzodp +jbrenqtlagxhtvmwyhcfukzbdp +jbrenqwlagxhivmwyscfutzopp +jbrenqtlavxhibmtyscfukzodp +jbronqtlagxnivmwyscfuzzodp +jbredqtlagxhppmwyscfukzodp +jbrcnqtlogxhivmwysxfukzodp +jbremqtlagehivswyscfukzodp +jbrenqolagxhivmcyscfukzokp +jbrehqtlacxhgvmwyscfukzodp +fbrlnqtlagxhivmwyscbukzodp +zbrfnqtlagxhivrwyscfukzodp +jbregqtlagxnivmwyscfhkzodp +jbrenqtllgxnivmwystfukzodp +jurenqtlagxhivmwyscfulzoup +jbrenitdagxhivmwyxcfukzodp +jbrenqtlagxqivmwyscvuszodp +jbqenqwlagxhivmwyscfckzodp +jbrenqtlagxhivmwxscqupzodp +jbrenqtlagxhivmwysciuqiodp +jbrjnjtlagxhivmwyscfukzode +jbrenqtlagxhuvmwqscfukzods +jbrenqtlagxhuvmuyscfukzudp +ibrenqtlagxhivmwyscfuktokp +jbsenqtlagxhivcwyscfuksodp +jbrfnntlagxhivmwnscfukzodp +jzrenqulagxhivmwyscfukzodx +jbrenqtqygxhivmwyscfukzwdp +jbrenqtlagxfixmwyscfukzcdp +jbrenqaoagxhivmwyshfukzodp +jbrenqtlazxhivmworcfukzodp +jbrenqtlagxhicowyscfukrodp +jbrqnqtlagxhivzwyzcfukzodp +jbrenqtlalxhuvxwyscfukzodp +jbrenqtlqgxhhviwyscfukzodp +jbrenqtuggxhivmoyscfukzodp +jbrenqtlagxpivmwyscfukkodw +zbrenqhlagxhivmwyscdukzodp +jbrenutlagxxivmwyscfukzoqp +obrenqtlagxhivmwxscfuszodp +jbrenqtlagxhlvmwyscfuixodp +rbrenqtlagdhixmwyscfukzodp +jbrenqtlagxhivmwescfyszodp +jbrfnqtlagxhivmwyscaukzhdp +jbrenqtiagxhivmbyscfuxzodp +cbrrnqtuagxhivmwyscfukzodp +jbkenqtlagxhigmwysufukzodp +jbjewqtlagxhivmwyscfuqzodp +jbrznqtlagxvivmwyscfukzovp +jbrenttlacxhivmwyscfhkzodp +jblenqtlagxhivmwylcfukaodp +jbrenqtlagxhivmqysiftkzodp +jbrenqtlagwhikmwyscfukqodp +jbrenqtlegxhivmwvsckukzodp +jbrenqwzagxhiamwyscfukzodp +jbrenqtlagxhivcwyscfgkzodc +jbrenqtlagxxhvmwxscfukzodp +jbrenqtlngxhivmwyscfukoowp +jbreomtlagxhivmwpscfukzodp +jfrenqtlagxhivmwyscnumzodp +jbrenqtlagphipmwyscfukfodp +jvrenqtlagxhivmwyscfmkzodw +jbrenqtlaxxoiemwyscfukzodp +jbrenqtlagxhivmwyscemkzpdp +jbrenyjldgxhivmwyscfukzodp +jbrenqtlagxhivfvyspfukzodp +kbrenctlakxhivmwyscfukzodp +jbrmhqtlagxhivmwyscfuizodp +jbjenqtlagxlivmbyscfukzodp +jbrenqtlaaxhivmmyshfukzodp +jbronqtlagxhirmvyscfukzodp +jbcrnqtlagxwivmwyscfukzodp +jxrenszlagxhivmwyscfukzodp +jbpenqtlagxhivmwyscfukkody +jbrewqtlawxhivmwyscfukzhdp +jbrenqylagxhivmwlxcfukzodp +jbrenqtlagxxivtwywcfukzodp +jbrenqtlagxhcvgayscfukzodp +jbrenitlagxhivmwiscfukzohp +jbrenutlagxhivmwyscbukvodp +nbrenqtlagxhivmwysnfujzodp +jbrenqtlagxhivmwyqcfupzoop +jbrenqtrarxhijmwyscfukzodp +jbrenqtlagxhivmwysdfukzovy +jbrrnqtlagxhivmwyvcfukzocp +jbrenqtlagxhivmwyscfuvzzhp +jbhenitlagxhivmwysufukzodp +jbrenqtlagxhivmwyscfuwzoqx +kbrenqtlagxhivmwysqfdkzodp +jbrenqtlagxhivmwyxmfukzodx +jbcenatlagxxivmwyscfukzodp +jbrenhtlagvhdvmwyscfukzodp +jxrenqtlafxhivfwyscfukzodp +jbreaztlpgxhivmwyscfukzodp +tqrenqtlagxfivmwyscfukzodp +jbrenqgllgxhwvmwyscfukzodp +jbrejjtlagxhivmgyscfukzodp +jbrenqtlagxhivmwyscvukzoqv +jbrvnqtlagxsibmwyscfukzodp +jbrenqttagxhuvmwyscfukvodp +jbrenqteagxhivmwcscfukqodp +jbrenqtsabxhivmwyspfukzodp +jbbenqtlagxhivmwyscjukztdp +jnrenqtlagxhiimwydcfukzodp +jbrenqtlagxhfvmwyscxukzodu +jbrenqtluyxhiomwyscfukzodp +jbrenqvlagxhivmwyscuukzolp +ebrenqtlagxnivmwysrfukzodp +jbreeqtlatxhigmwyscfukzodp +jbrenqtvxgxhivmwyscfukzedp +jbrmnqtlagxhivmwywcfuklodp +jbreeqtvagxhivmwyscfukzody +jbrenptlagxhivmxyscfumzodp +jbrenqtlagxhivmwysgfukzfsp +jurenqtlagjhivmwkscfukzodp +jbrenntlagxhivmwtscffkzodp +jbrenqglagxhivmwyocfokzodp +wbrenqtlagxhivmwhscfukiodp +jbrenqtligxhivmqascfukzodp +jbrenqtlagxhivmwxscfukpojp +jurenqtlagxhivmmyscfbkzodp +jbrenqtmagxhivmwyscfrbzodp +jcrenqtlagxhivmwysefukzodm +jbrenqtlagxhicmwywcfukzodl +jbvanqtlagfhivmwyscfukzodp +jbmenqjlagxhivmwyscfdkzodp +jbrenqtlagohivvwysctukzodp +jbrenqtdagxdivmwyscfckzodp +kbrefqtlagxhivmwyscfuazodp +jbrwnqtoagxhivmwyswfukzodp +jjhenqtlagxhivmwyscfukzorp +jbgsnqtlagxhivkwyscfukzodp +jbrynqtlagxhivmsyspfukzodp +jbrenftlmkxhivmwyscfukzodp +nbrenqtxagxhmvmwyscfukzodp +jbrunqtlagxhijmwysmfukzodp +jbrenqtlagmaivmwyscfukzowp +jbrerqtlagxhihmwyscfukzudp +jbrenqtlagahivmwysckukzokp +kbrenqtlagxhirmwyscfupzodp +jbrrnqtlagxhivmwyecfukzodz +jbrenqtlavxhivmwyscfusiodp +jnrenqtlagxhivmwyhcfukzodw +jbretqtlagfhivmwyscfukzrdp +jbreoqtnagxhivmwyscfukzopp +jbrenbtllgxhivmwsscfukzodp +jbrenqtlmgxhivmwyscfuwzedp +jbnenqtlagxhivbwyscfukzokp +jbrenqslagxhivmvyscfukzndp +jbrenqtlagxzivmwuscfukztdp +gbrenqtlagxhyvmwyscfukjodp +jbrenqteagxhivmwyscfuszedp +jbrenqtlaglhivmwysafukkodp +jbrenqtlagxhcvmwascfukzogp +jbrenqtlagxhsvmkcscfukzodp +jbrenqslbgxhivmwyscfufzodp +cbrenqtlagxhivkwtscfukzodp +jbrenqtltgxhivmzyscfukzodj +jbrgnqtlagihivmwyycfukzodp +vbrenqauagxhivmwyscfukzodp +jbrqnqtlagjhivmwyscfqkzodp +jbrenqtlakxhivmwyscfukvobp +jcrenqelagxhivmwtscfukzodp +jbrrnqtlagxhlvmwyscfukzodw +jbrenqtlagxhivmwkscaumzodp +jbrenqdlagxhivmiescfukzodp +jhrenqtlagxhqvmwyscmukzodp +jbrenqtlaghhivmwyscfukkoyp +jowenqtlagxyivmwyscfukzodp +jbrenitaagxhivmwyscfqkzodp +jbrenqtlagxhivmwyscfnkbudp +jbyenqtlagxhivmiyscfukzhdp +jbrenitlagxhibjwyscfukzodp +jbrenqtlavxhjvmwpscfukzodp +jbrenqyaagxhivmwyscflkzodp +jbrenqylagxhivmwyicfupzodp +jbrenqtlagxmevmwylcfukzodp +lbrenqtlagxhiqmwyscfikzodp +jbrenqtnarxhivmwyscfmkzodp +jbrenqtlamxhivmwyscfnkzorp +jbbenqtlavxhivmwyscjukztdp +jbrenqtlagxhivmwyscfnliodp +jbwenetlagxhivmwyscfukzodt +jbrenatlagxhivmwysmfujzodp +jbrsnstlagxhivmwyscfukgodp +jbwvnitlagxhivmwyscfukzodp +jbrenqtbagxhkvmwypcfukzodp +jbrlnqtlafxhivmwyscfukdodp +jbrenztlanxhivmwyscjukzodp +jbrepqtlagxhivmwudcfukzodp +jbrenqtlagxiivmwdscfskzodp +jbrdjqtlagxhivmwyschukzodp +jbrenqtoaguhivmwyccfukzodp +jdrexqjlagxhivmwyscfukzodp +jbrenqtlagxhovmwysckukaodp +pbrfnqblagxhivmwyscfukzodp +jbrenqtlagxrivgiyscfukzodp +jbrelqtgagxhivmryscfukzodp +jbrenqtlagxhicmwjscfikzodp +jbrenqjlagxhivmwyscfmkjodp +jbrenqtlagxpivmwzscgukzodp +jbienqzlagxpivmwyscfukzodp +jbrenqvlagxhivmwdscfukzodx +owrenqtlagxhivmwyicfukzodp +gbrenqtlaathivmwyscfukzodp +jbgenqtlafxhivmwysqfukzodp +jbrenqtlagxhivtwsscfukzokp +jbrnnqylanxhivmwyscfukzodp +ebrenqolagxhivmcyscfukzodp +jbrenqtlarnhivgwyscfukzodp +jbmenqtlagxhivmvyscfukzgdp +jbrevqtlaglhivmwystfukzodp +jbrenqplanthivmwyscfukzodp +jbrenqtlagxhivmkyscbukzosp +jbrenqtlagxaivmwyscfugzodo +jbrenqplagxhnvmwyscfjkzodp +jbrenqtlagxhivgwyscfusrodp +cbrenqtlagxhivmwysmfukzody +jbrenquwaexhivmwyscfukzodp +jbredqtlagxhdvmwyscfukzoup +jbrxnqtlagxhivmwysczukaodp +jbrenqtlafnhivmwyscfuczodp +jbbdkqtlagxhivmwyscfukzodp +ubrenqtlagxhivkwyucfukzodp +ebjenqtlagxhivmwyscfukzodj +jbgenqtlugxxivmwyscfukzodp +jbrenqtoagxqivmwdscfukzodp +bbeenqtlagxhivmwyscfumzodp +jbfeeqtlagxhivmwmscfukzodp +jbrlnqtlagxhiimwescfukzodp +jbrenqtlagwoivmwyscfukhodp +jbrenqtlagnhivmwyscfuszovp -- cgit v1.2.3-70-g09d2