diff --git a/2015/04/4.md b/2015/04/4.md index 667771c..f4e7b9d 100644 --- a/2015/04/4.md +++ b/2015/04/4.md @@ -22,13 +22,19 @@ For example: to make an MD5 hash starting with five zeroes is `1048970`; that is, the MD5 hash of `pqrstuv1048970` looks like `000006136ef...`. +Your puzzle answer was `254575`. + ## \-\-- Part Two \-\-- {#part2} Now find one that starts with *six zeroes*. +Your puzzle answer was `1038736`. + Both parts of this puzzle are complete! They provide two gold stars: \*\* At this point, you should [return to your Advent calendar](/2015) and try another puzzle. +Your puzzle input was `bgvyzdsv`{.puzzle-input}. + diff --git a/2015/05/solution.py b/2015/05/solution.py index 0c39fe0..252983f 100644 --- a/2015/05/solution.py +++ b/2015/05/solution.py @@ -6,7 +6,7 @@ from fred import list2int input_f = 'input' -part = 2 +part = 1 ######################################### # # # Part 1 # diff --git a/2015/06/6.md b/2015/06/6.md new file mode 100644 index 0000000..d0fe435 --- /dev/null +++ b/2015/06/6.md @@ -0,0 +1,75 @@ +## \-\-- Day 6: Probably a Fire Hazard \-\-- + +Because your neighbors keep defeating you in the holiday house +decorating contest year after year, you\'ve decided to deploy one +million lights in a [1000x1000 +grid]{title="Hey, be glad I'm not asking for the resistance between two points!"}. + +Furthermore, because you\'ve been especially nice this year, Santa has +mailed you instructions on how to display the ideal lighting +configuration. + +Lights in your grid are numbered from 0 to 999 in each direction; the +lights at each corner are at `0,0`, `0,999`, `999,999`, and `999,0`. The +instructions include whether to `turn on`, `turn off`, or `toggle` +various inclusive ranges given as coordinate pairs. Each coordinate pair +represents opposite corners of a rectangle, inclusive; a coordinate pair +like `0,0 through 2,2` therefore refers to 9 lights in a 3x3 square. The +lights all start turned off. + +To defeat your neighbors this year, all you have to do is set up your +lights by doing the instructions Santa sent you in order. + +For example: + +- `turn on 0,0 through 999,999` would turn on (or leave on) every + light. +- `toggle 0,0 through 999,0` would toggle the first line of 1000 + lights, turning off the ones that were on, and turning on the ones + that were off. +- `turn off 499,499 through 500,500` would turn off (or leave off) the + middle four lights. + +After following the instructions, *how many lights are lit*? + +Your puzzle answer was `377891`. + +## \-\-- Part Two \-\-- {#part2} + +You just finish implementing your winning light pattern when you realize +you mistranslated Santa\'s message from Ancient Nordic Elvish. + +The light grid you bought actually has individual brightness controls; +each light can have a brightness of zero or more. The lights all start +at zero. + +The phrase `turn on` actually means that you should increase the +brightness of those lights by `1`. + +The phrase `turn off` actually means that you should decrease the +brightness of those lights by `1`, to a minimum of zero. + +The phrase `toggle` actually means that you should increase the +brightness of those lights by `2`. + +What is the *total brightness* of all lights combined after following +Santa\'s instructions? + +For example: + +- `turn on 0,0 through 0,0` would increase the total brightness by + `1`. +- `toggle 0,0 through 999,999` would increase the total brightness by + `2000000`. + +Your puzzle answer was `14110788`. + +Both parts of this puzzle are complete! They provide two gold stars: +\*\* + +At this point, you should [return to your Advent calendar](/2015) and +try another puzzle. + +If you still want to see it, you can [get your puzzle +input](6/input). + diff --git a/2015/06/solution.py b/2015/06/solution.py new file mode 100644 index 0000000..5ac4e32 --- /dev/null +++ b/2015/06/solution.py @@ -0,0 +1,90 @@ +#!/bin/python3 +import sys,time,re +from pprint import pprint +from collections import defaultdict +from itertools import product + +sys.path.insert(0, '../../') +from fred import list2int,get_re,nprint,lprint,loadFile +start_time = time.time() + +input_f = 'input' + +######################################### +# # +# Part 1 # +# # +######################################### +def part1(): + instructions = [] + + with open(input_f) as file: + tmp = [] + for line in file: + tmp = [re.match(r'.+?(?=\d)',line).group().strip()] + tmp += [int(i) for i in re.findall(r'\d+',line)] + instructions.append(tmp) + + size = 1000 + maps = defaultdict(bool) + + for i in instructions: + for x in product(range(i[1],i[3]+1),range(i[2],i[4]+1)): + if i[0] == 'turn off': + maps[x] = False + elif i[0] == 'turn on': + maps[x] = True + else: + if maps[x] == True: + maps[x] = False + else: + maps[x] = True + count = 0 + + for i in product(range(0,size),range(0,size)): + if maps[i] == True: + count += 1 + return count + +start_time = time.time() +print('Part 1:',part1(), '\t\t', round((time.time() - start_time)*1000), 'ms') + + +######################################### +# # +# Part 2 # +# # +######################################### +def part2(): + instructions = [] + + with open(input_f) as file: + tmp = [] + for line in file: + tmp = [re.match(r'.+?(?=\d)',line).group().strip()] + tmp += [int(i) for i in re.findall(r'\d+',line)] + instructions.append(tmp) + + size = 1000 + + maps = defaultdict(int) + + for i in instructions: + for x in product(range(i[1],i[3]+1),range(i[2],i[4]+1)): + if i[0] == 'turn off': + if maps[x] != 0: + maps[x] -= 1 + elif i[0] == 'turn on': + maps[x] += 1 + else: + maps[x] += 2 + + count = 0 + + for i in product(range(0,size),range(0,size)): + count += maps[i] + + return count + +start_time = time.time() +print('Part 2:',part2(), '\t', round((time.time() - start_time)*1000), 'ms') \ No newline at end of file diff --git a/2015/day4/input b/2015/day4/input deleted file mode 100644 index bf3e46f..0000000 --- a/2015/day4/input +++ /dev/null @@ -1 +0,0 @@ -bgvyzdsv diff --git a/2015/day4/part1.py b/2015/day4/part1.py deleted file mode 100644 index d227e50..0000000 --- a/2015/day4/part1.py +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/python3 - -import sys -from pprint import pprint -import hashlib - -input_f = sys.argv[1] - -result = 0 -count = 0 -found = False -with open(input_f) as file: - for line in file: - tmp = line.rstrip() - while found == False: - m = hashlib.md5() - text = tmp + str(count) - #print(text) - m.update(text.encode('UTF-8')) - nr = m.hexdigest() - #print(nr) - - if nr[0:5] == '00000': - print(count) - print(text) - print(nr) - found = True - else: - count += 1 - #print(nr[ 0 : 5 ]) - found = False diff --git a/2015/day4/part2.py b/2015/day4/part2.py deleted file mode 100644 index f0d53c2..0000000 --- a/2015/day4/part2.py +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/python3 - -import sys -from pprint import pprint -import hashlib - -input_f = sys.argv[1] - -result = 0 -count = 0 -found = False -with open(input_f) as file: - for line in file: - tmp = line.rstrip() - while found == False: - m = hashlib.md5() - text = tmp + str(count) - #print(text) - m.update(text.encode('UTF-8')) - nr = m.hexdigest() - #print(nr) - - if nr[0:6] == '000000': - print(count) - print(text) - print(nr) - found = True - else: - count += 1 - #print(nr[ 0 : 5 ]) - found = False diff --git a/2015/day4/test b/2015/day4/test deleted file mode 100644 index e083919..0000000 --- a/2015/day4/test +++ /dev/null @@ -1,2 +0,0 @@ -abcdef -pqrstuv diff --git a/2015/day5/input b/2015/day5/input deleted file mode 100644 index 7bc179c..0000000 --- a/2015/day5/input +++ /dev/null @@ -1,1000 +0,0 @@ -uxcplgxnkwbdwhrp -suerykeptdsutidb -dmrtgdkaimrrwmej -ztxhjwllrckhakut -gdnzurjbbwmgayrg -gjdzbtrcxwprtery -fbuqqaatackrvemm -pcjhsshoveaodyko -lrpprussbesniilv -mmsebhtqqjiqrusd -vumllmrrdjgktmnb -ptsqjcfbmgwdywgi -mmppavyjgcfebgpl -zexyxksqrqyonhui -npulalteaztqqnrl -mscqpccetkktaknl -ydssjjlfejdxrztr -jdygsbqimbxljuue -ortsthjkmlonvgci -jfjhsbxeorhgmstc -vdrqdpojfuubjbbg -xxxddetvrlpzsfpq -zpjxvrmaorjpwegy -laxrlkntrukjcswz -pbqoungonelthcke -niexeyzvrtrlgfzw -zuetendekblknqng -lyazavyoweyuvfye -tegbldtkagfwlerf -xckozymymezzarpy -ehydpjavmncegzfn -jlnespnckgwmkkry -bfyetscttekoodio -bnokwopzvsozsbmj -qpqjhzdbuhrxsipy -vveroinquypehnnk -ykjtxscefztrmnen -vxlbxagsmsuuchod -punnnfyyufkpqilx -zibnnszmrmtissww -cxoaaphylmlyljjz -zpcmkcftuuesvsqw -wcqeqynmbbarahtz -kspontxsclmbkequ -jeomqzucrjxtypwl -ixynwoxupzybroij -ionndmdwpofvjnnq -tycxecjvaxyovrvu -uxdapggxzmbwrity -csskdqivjcdsnhpe -otflgdbzevmzkxzx -verykrivwbrmocta -ccbdeemfnmtputjw -suyuuthfhlysdmhr -aigzoaozaginuxcm -ycxfnrjnrcubbmzs -fgbqhrypnrpiizyy -taoxrnwdhsehywze -echfzdbnphlwjlew -jhmomnrbfaawicda -fywndkvhbzxxaihx -aftuyacfkdzzzpem -yytzxsvwztlcljvb -iblbjiotoabgnvld -kvpwzvwrsmvtdxcx -ardgckwkftcefunk -oqtivsqhcgrcmbbd -wkaieqxdoajyvaso -rkemicdsrtxsydvl -sobljmgiahyqbirc -pbhvtrxajxisuivj -ggqywcbfckburdrr -gmegczjawxtsywwq -kgjhlwyonwhojyvq -bpqlmxtarjthtjpn -pxfnnuyacdxyfclr -isdbibbtrqdfuopn -vucsgcviofwtdjcg -ywehopujowckggkg -mzogxlhldvxytsgl -mllyabngqmzfcubp -uwvmejelibobdbug -brebtoppnwawcmxa -fcftkhghbnznafie -sqiizvgijmddvxxz -qzvvjaonnxszeuar -abekxzbqttczywvy -bkldqqioyhrgzgjs -lilslxsibyunueff -ktxxltqgfrnscxnx -iwdqtlipxoubonrg -twncehkxkhouoctj -bdwlmbahtqtkduxz -smbzkuoikcyiulxq -bjmsdkqcmnidxjsr -icbrswapzdlzdanh -eyszxnhbjziiplgn -pdxhrkcbhzqditwb -nfulnpvtzimbzsze -glayzfymwffmlwhk -bejxesxdnwdlpeup -ukssntwuqvhmsgwj -hoccqxlxuuoomwyc -rapztrdfxrosxcig -cxowzhgmzerttdfq -yzhcurqhdxhmolak -kqgulndpxbwxesxi -yjkgcvtytkitvxiu -xnhfqhnnaceaqyue -qkuqreghngfndifr -xesxgeaucmhswnex -occbvembjeuthryi -dmefxmxqjncirdwj -ystmvxklmcdlsvin -pplykqlxmkdrmydq -cbbjkpbdvjhkxnuc -embhffzsciklnxrz -asrsxtvsdnuhcnco -xcbcrtcnzqedktpi -mglwujflcnixbkvn -mnurwhkzynhahbjp -cekjbablkjehixtj -kbkcmjhhipcjcwru -usifwcsfknoviasj -rsfgocseyeflqhku -prgcyqrickecxlhm -asbawplieizkavmq -sylnsirtrxgrcono -nzspjfovbtfkloya -qfxmsprfytvaxgtr -yckpentqodgzngnv -ycsfscegcexcnbwq -kbmltycafudieyuh -tpahmvkftilypxuf -qivqozjrmguypuxu -gdhbfradjuidunbk -vxqevjncsqqnhmkl -rpricegggcfeihst -xucvzpprwtdpzifq -egyjcyyrrdnyhxoo -kfbrzmbtrrwyeofp -qpjdsocrtwzpjdkd -reboldkprsgmmbit -vwkrzqvvhqkensuy -ydvmssepskzzvfdp -vqbigplejygdijuu -mzpgnahrhxgjriqm -uiejixjadpfsxqcv -tosatnvnfjkqiaha -yipuojpxfqnltclx -pcxwvgcghfpptjlf -shrudjvvapohziaj -jdckfjdtjsszdzhj -hgisfhcbdgvxuilk -gytnfjmrfujnmnpp -ohflkgffnxmpwrrs -jzxajbkwwjknasjh -xrcxfollmejrislv -djjlwykouhyfukob -rittommltkbtsequ -lpbvkxdcnlikwcxm -vkcrjmcifhwgfpdj -dkhjqwtggdrmcslq -swnohthfvjvoasvt -yrzoksmcnsagatii -duommjnueqmdxftp -inlvzlppdlgfmvmx -xibilzssabuqihtq -inkmwnvrkootrged -ldfianvyugqtemax -gbvwtiexcuvtngti -temjkvgnwxrhdidc -askbbywyyykerghp -onezejkuwmrqdkfr -kybekxtgartuurbq -ubzjotlasrewbbkl -stueymlsovqgmwkh -lhduseycrewwponi -yohdmucunrgemqcu -onnfbxcuhbuifbyc -odrjkigbrsojlqbt -imqkqqlkgmttpxtx -sxmlkspqoluidnxw -akaauujpxhnccleb -xvgpghhdtpgvefnk -jdxeqxzsbqtvgvcq -mdusenpygmerxnni -agihtqvgkmgcbtaw -dovxcywlyvspixad -uulgazeyvgtxqkfz -ndhmvrwuflhktzyo -hcaqkmrbvozaanvm -tvfozbqavqxdqwqv -rlkpycdzopitfbsv -dmyjtmjbtnvnedhs -fmwmqeigbzrxjvdu -twgookcelrjmczqi -grxosmxvzgymjdtz -zsstljhzugqybueo -jpeapxlytnycekbd -iasykpefrwxrlvxl -azohkkqybcnsddus -aoaekngakjsgsonx -awsqaoswqejanotc -sgdxmketnjmjxxcp -ylnyuloaukdrhwuy -ewoqjmakifbefdib -ytjfubnexoxuevbp -ewlreawvddptezdd -vmkonztwnfgssdog -ahbpuqygcwmudyxn -kmahpxfjximorkrh -otjbexwssgpnpccn -aewskyipyztvskkl -urqmlaiqyfqpizje -nrfrbedthzymfgfa -vndwwrjrwzoltfgi -iiewevdzbortcwwe -qiblninjkrkhzxgi -xmvaxqruyzesifuu -yewuzizdaucycsko -hmasezegrhycbucy -dwpjrmkhsmnecill -hnffpbodtxprlhss -avmrgrwahpsvzuhm -nksvvaswujiukzxk -zzzapwhtffilxphu -vwegwyjkbzsrtnol -qurpszehmkfqwaok -iknoqtovqowthpno -brlmpjviuiagymek -efxebhputzeulthq -mzkquarxlhlvvost -xsigcagzqbhwwgps -qufztljyzjxgahdp -dlfkavnhobssfxvx -hgdpcgqxjegnhjlr -fboomzcvvqudjfbi -wnjuuiivaxynqhrd -nhcgzmpujgwisguw -wjeiacxuymuhykgk -qmeebvxijcgdlzpf -nmmnxsehhgsgoich -ejluaraxythbqfkl -mdbsbwnaypvlatcj -nnfshfibmvfqrbka -dvckdmihzamgqpxr -foztgqrjbwyxvewk -okpryqcbvorcxhoh -fpiwsndulvtthctx -zrbiovlmzdmibsiq -setwafbnnzcftutg -nyvqghxhgkxfobdm -enpvqadzarauhajl -twblhpvkazpdmhmr -lbhlllsgswvhdesh -tdfwkgxnqjxcvsuo -lnvyjjbwycjbvrrb -jsxqdvmzaydbwekg -xirbcbvwlcptuvoa -hwnukxenilatlfsk -khwopjqkxprgopmd -sljzdoviweameskw -stkrdmxmpaijximn -fdilorryzhmeqwkc -mfchaaialgvoozra -gjxhoxeqgkbknmze -beowovcoqnginrno -mkgmsgwkwhizunxo -phnhfusyoylvjdou -csehdlcmwepcpzmq -pgojomirzntgzohj -fkffgyfsvwqhmboz -mrvduasiytbzfwdn -epzrmsifpmfaewng -ooqxnoyqrlozbbyf -ahcxfmgtedywrbnx -ibqktvqmgnirqjot -xarssauvofdiaefn -xradvurskwbfzrnw -nxklmulddqcmewad -twichytatzoggchg -qmgvroqwrjgcycyv -yvezgulgrtgvyjjm -jgmcklzjdmznmuqk -bytajdwwconasjzt -apjttucpycyghqhu -flfejjzihodwtyup -gmrtrwyewucyqotv -nlohdrlymbkoenyl -wxcmqwbrwgtmkyfe -njtzlceyevmisxfn -htbbidsfbbshmzlt -gxhjeypjwghnrbsf -cifcwnbtazronikv -ezvjijcjcyszwdjy -srffeyrvyetbecmc -xpjefrtatrlkbkzl -yhncvfqjcyhsxhbb -pqhcufzlcezhihpr -qtdsfvxfqmsnzisp -dfonzdicxxhzxkrx -mqqqzhxkyfpofzty -dodjadoqyxsuazxt -jjwkrlquazzjbvlm -ttosfloajukoytfb -llateudmzxrzbqph -criqihrysgesmpsx -npszvlittbcxxknj -qmzojrvraitrktil -cfyoozzpwxwkwoto -daxohtcgvtktggfw -vthkpkoxmiuotjaj -pkfkyobvzjeecnui -ojcjiqrfltbhcdze -scbivhpvjkjbauun -ysowvwtzmqpjfwyp -laeplxlunwkfeaou -jufhcikovykwjhsa -xrucychehzksoitr -pyaulaltjkktlfkq -oypfrblfdhwvqxcv -zybrgxixvhchgzcf -puoagefcmlxelvlp -xjnhfdrsbhszfsso -ocgvzryoydaoracw -bxpnqllmptkpeena -pziyeihxlxbbgdio -bvtrhtlbfzmglsfc -ggpuvtseebylsrfk -pukenexjqecnivfj -jswabfbzpnhhdbpn -enojrtwqpfziyqsv -rjtmxudgcudefuiz -iqmjxynvtvdacffc -uheywxlsusklitvl -kwhxduejafdpmqdc -rspgblenbqlmcltn -rczhurnrqqgjutox -dqhytibjzxkdblzl -hpbieadydiycvfys -pucztfoqvenxiuym -nqpfzgpblwijiprf -ltgseeblgajbvltk -mwxukbsnapewhfrc -dvxluiflicdtnxix -pexfbpgnqiqymxcq -dakudfjjwtpxuzxy -letlceyzlgmnrewu -ojktahbsdifdfhmd -anezoybbghjudbih -sawxtlvzysaqkbbf -ttnkctcevpjiwqua -edrwrdvbaoqraejd -wnbfilvuienjxlcr -wqhzwvyybyxhhtsm -jxbgvyaqczwdlxfo -wbypqfmbwrsvfmdv -izdxjyfpidehbets -vbxbggqseurknjor -egpmpoxickhvwdlz -ivfrzklvpwoemxsy -xkziseheibmrpdww -xnrmtoihaudozksa -efemdmbxdsaymlrw -yjdjeckmsrckaagx -vlftqxxcburxnohv -fwyquwgajaxebduj -dwpmqvcxqwwnfkkr -isduxxjfsluuvwga -avdtdppodpntojgf -vrcoekdnutbnlgqk -kbhboxjmgomizxkl -cgsfpjrmewexgzfy -usdtnhjxbvtnafvp -bjoddgxbuxzhnsqd -hoyqdzofddedevsb -rwiwbvqfjajotaoj -iabomphsuyfptoos -bubeonwbukprpvhy -xurgunofmluhisxm -puyojzdvhktawkua -dbvqhztzdsncrxkb -oaeclqzyshuuryvm -nmgwfssnflxvcupr -vjkiwbpunkahtsrw -romyflhrarxchmyo -yecssfmetezchwjc -qwtocacqdslhozkd -mesexvfbtypblmam -mtjucgtjesjppdtt -pvodhqqoeecjsvwi -vvlcwignechiqvxj -wiqmzmmjgjajwgov -kwneobiiaixhclev -lkdeglzrrxuomsyt -oqovuwcpwbghurva -lfsdcxsasmuarwwg -awkbafhswnfbhvck -sztxlnmyvqsiwljg -hozxgyxbcxjzedvs -oifkqgfqmflxvyzn -mfvnehsajlofepib -delgbyfhsyhmyrfa -uenimmwriihxoydv -vjqutpilsztquutn -kfebsaixycrodhvl -coifyqfwzlovrpaj -xiyvdxtkqhcqfsqr -hoidcbzsauirpkyt -fiumhfaazfkbaglq -fzwdormfbtkdjgfm -faxqrortjdeihjfv -ljhaszjklhkjvrfi -pzrxsffkuockoqyl -immbtokjmwyrktzn -lzgjhyiywwnuxpfx -vhkocmwzkfwjuzog -ghntjkszahmdzfbl -gbcthxesvqbmzggy -oyttamhpquflojkh -nbscpfjwzylkfbtv -wnumxzqbltvxtbzs -jfhobjxionolnouc -nrtxxmvqjhasigvm -hweodfomsnlgaxnj -lfgehftptlfyvvaj -ccoueqkocrdgwlvy -euhgvirhsaotuhgf -pdlsanvgitjvedhd -seokvlbhrfhswanv -pntdqaturewqczti -jkktayepxcifyurj -dhzzbiaisozqhown -wehtwakcmqwczpbu -zwvozvspqmuckkcd -efucjlrwxuhmjubr -lzodaxuyntrnxwvp -qdezfvpyowfpmtwd -mizijorwrkanesva -txmitbiqoiryxhpz -xhsqgobpouwnlvps -muixgprsknlqaele -disgutskxwplodra -bmztllsugzsqefrm -ymwznyowpaaefkhm -ebfifzloswvoagqh -pkldomvvklefcicw -ziqzbbfunmcgrbtq -iuekfpbkraiwqkic -jflgjidirjapcuqo -achsfbroyrnqnecg -udbhouhlgjjzapzr -arerrohyhhkmwhyo -txyjzkqexgvzdtow -ogzrjwibvzoucrpg -rfdftaesxdnghwhd -axdhwmpuxelmpabo -gtktemowbsvognac -wkfuclilhqjzxztk -qbwjouutzegaxhrz -opfziwqqbwhzzqhj -pvcvcsupfwsmeacs -xsbohvbguzsgpawn -sczoefukwywxriwj -oqkhcqfdeaifbqoc -vtsrholxbjkhwoln -yuvapljnwbssfbhi -dxdfwccqvyzeszyl -gdbmjtonbiugitmb -qunirtqbubxalmxr -zzxsirhdaippnopr -fibtndkqjfechbmq -gqgqyjvqmfiwiyio -ihwsfkwhtzuydlzw -eygyuffeyrbbhlit -zdlsaweqomzrhdyy -ptbgfzuvxiuuxyds -llxlfdquvovzuqva -wfrltggyztqtyljv -kwipfevnbralidbm -gbhqfbrvuseellbx -obkbuualrzrakknv -hlradjrwyjgfqugu -vtqlxbyiaiorzdsp -tedcbqoxsmbfjeyy -cxdppfvklbdayghy -gjnofexywmdtgeft -ldzeimbbjmgpgeax -egrwsmshbvbawvja -vadfrjvcrdlonrkg -mojorplakzfmzvtp -jyurlsoxhubferpo -ijwqogivvzpbegkm -cnmetoionfxlutzg -lawigelyhegqtyil -mqosapvnduocctcd -eqncubmywvxgpfld -vigfretuzppxkrfy -ncwynsziydoflllq -cbllqinsipfknabg -ndtbvdivzlnafziq -iqrrzgzntjquzlrs -damkuheynobqvusp -jxctymifsqilyoxa -ylritbpusymysmrf -paoqcuihyooaghfu -obhpkdaibwixeepl -igrmhawvctyfjfhd -ybekishyztlahopt -vkbniafnlfqhhsrq -kltdigxmbhazrywf -ufhcoyvvxqzeixpr -klcxdcoglwmeynjt -funpjuvfbzcgdhgs -akgyvyfzcpmepiuc -zhlkgvhmjhwrfmua -ibsowtbnrsnxexuz -vpufbqilksypwlrn -ngrintxhusvdkfib -ziuwswlbrxcxqslw -sucledgxruugrnic -zwnsfsyotmlpinew -oaekskxfcwwuzkor -qjmqwaktpzhwfldu -tmgfgqgpxaryktxo -qfaizepgauqxvffk -addkqofusrstpamf -shdnwnnderkemcts -gwfygbsugzptvena -fpziernelahopdsj -bkkrqbsjvyjtqfax -gxrljlqwxghbgjox -ipfwnqaskupkmevm -nnyoyhnqyfydqpno -lgzltbrrzeqqtydq -fgzxqurhtdfucheb -jvpthtudlsoivdwj -bmlhymalgvehvxys -fhklibetnvghlgnp -hfcyhptxzvblvlst -donanindroexgrha -oqawfmslbgjqimzx -jzgehjfjukizosep -bhlgamcjqijpvipb -jrcrdjrvsyxzidsk -ouwfwwjqezkofqck -wrvsbnkhyzayialf -knhivfqjxrxnafdl -hbxbgqsqwzijlngf -qlffukpfmnxpfiyq -evhxlouocemdkwgk -baxhdrmhaukpmatw -nwlyytsvreqaminp -ljsjjzmlsilvxgal -onunatwxfzwlmgpk -njgolfwndqnwdqde -ngdgcjzxupkzzbqi -ieawycvvmvftbikq -ccyvnexuvczvtrit -enndfwjpwjyasjvv -tcihprzwzftaioqu -bkztdkbrxfvfeddu -qkvhtltdrmryzdco -rurtxgibkeaibofs -mjxypgscrqiglzbp -unpkojewduprmymd -csqtkhjxpbzbnqog -mednhjgbwzlhmufi -sfrwfazygygzirwd -ijqeupbrhhpqxota -cmhpncanwudyysyh -wwcxbwzrplfzrwxd -jriomldifuobjpmq -radonyagpulnnyee -ryqjwxsspbbhnptd -yeoqpnsdhludlmzf -qsqlkeetyalenueh -qnnedenwsjdrcrzt -lejkuhsllxbhfcrx -anddbvllrrqefvke -wdtljquijaksvdsv -adslgvfuqqdkzvbc -whbccefjpcnjwhaq -kqrfuankaibohqsg -fyxisfwihvylgnfd -rwqdrddghyqudcif -syhzowthaaiiouaf -zjmrtgrnohxmtidu -deecwkfvjffxrzge -dztmvolqxkhdscxe -cdghcrgavygojhqn -pepqmdbjhnbugqeu -pnumdjpnddbxhieg -jzfhxeyahiagizfw -hdkwugrhcniueyor -gmgudeqlbmqynflu -toidiotdmfkxbzvm -pyymuoevoezlfkjb -etrbwuafvteqynlr -usvytbytsecnmqtd -dfmlizboawrhmvim -vrbtuxvzzefedlvs -vslcwudvasvxbnje -xdxyvoxaubtwjoif -mduhzhascirittdf -cqoqdhdxgvvvxamk -dshnfwhqjbhuznqr -zimthfxbdmkulkjg -luylgfmmwbptyzpj -iujpcgogshhotqrc -caqcyzqcumfljvsp -sprtitjlbfpygxya -fnconnrtnigkpykt -irmqaqzjexdtnaph -bbqrtoblmltvwome -ozjkzjfgnkhafbye -hwljjxpxziqbojlw -zahvyqyoqnqjlieb -dptshrgpbgusyqsc -uzlbnrwetkbkjnlm -yccaifzmvbvwxlcc -wilnbebdshcrrnuu -evxnoebteifbffuq -khbajekbyldddzfo -kjivdcafcyvnkojr -wtskbixasmakxxnv -uzmivodqzqupqkwx -rxexcbwhiywwwwnu -rowcapqaxjzcxwqi -fkeytjyipaxwcbqn -pyfbntonlrunkgvq -qiijveatlnplaifi -ltnhlialynlafknw -urrhfpxmpjwotvdn -xklumhfyehnqssys -civrvydypynjdoap -fvbmxnfogscbbnyd -oznavyflpzzucuvg -iyshrpypfbirahqo -qmzbfgelvpxvqecy -xkkxaufomsjbofmk -irlouftdmpitwvlq -csjoptbdorqxhnjg -bkryeshfsaqpdztm -guxbdqzfafsjoadl -tgrltexgrzatzwxf -cwsgsijqdanubxad -xafnexgturwrzyrg -apcrsqdbsbaxocxr -pspgxnzcevmvvejk -szephmeegvegugdt -ndjsoloeacasxjap -bdnfksliscnirjfu -ehglacmzpcgglpux -jwweijomqfcupvzw -yesblmmkqhbazmdu -sjsmalypmuslzgac -fkiqatyttlnuhdho -tlhnyuzdocvfdihq -ngehtjmycevnybga -obxodzcdgtrycgry -stkyrvdfbwovawmk -bdkhqcfrqaxhxloo -gpvumnuoiozipnrk -jbhanddinpqhxeol -hwkzkmbmsrvunzit -rfuomegkxbyamjpw -yzbljuksletipzwm -eafedkagwitzqigl -prenqvsbotqckgwy -spedpbwzphdrfxfz -cmsuqwemhwixkxet -xgdyeqbqfldvaccq -eooxgsrfsbdaolja -kyhqylxooewrhkho -mswieugqpoefmspt -uszoqundysdyeqlc -hkmjdggxefdyykbq -dtuhjnlaliodtlvh -oalbueqbhpxoxvvx -oowxtxsoqdwhzbya -lclajfsrpmtwvzkm -fxmjufpqtpyazeqo -ozlmreegxhfwwwmf -mqzrajxtxbaemrho -nfglecsyqduhakjr -nkxqtmasjjkpkqbp -jjfonbqimybvzeus -vjqkhkhjlmvpwkud -wxxhnvfhetsamzjr -pladhajujzttgmsw -dbycgxeymodsdlhm -qxszeuaahuoxjvwu -adultomodzrljxve -dmhgrbhvvpxyzwdn -slohrlwxerpahtyp -mngbocwyqrsrrxdb -facyrtflgowfvfui -hyvazpjucgghmmxh -twtrvjtncmewcxit -uejkrpvilgccfpfr -psqvolfagjfvqkum -nvzolslmiyavugpp -lpjfutvtwbddtqiu -fkjnfcdorlugmcha -eaplrvdckbcqqvhq -xrcydhkockycburw -iswmarpwcazimqxn -kicnnkjdppitjwrl -vwywaekzxtmeqrsu -dxlgesstmqaxtjta -pmeljgpkykcbujbb -vhpknqzhgnkyeosz -jprqitpjbxkqqzmz -fiprxgsqdfymyzdl -dzvfwvhfjqqsifga -aeakhfalplltmgui -frqrchzvenhozzsu -hsvikeyewfhsdbmy -puedjjhvxayiwgvg -zmsonnclfovjoewb -bnirelcaetdyaumi -szvudroxhcitatvf -sccfweuyadvrjpys -yiouqrnjzsdwyhwa -xyjhkqbnfmjjdefz -fjwgemkfvettucvg -aapqpwapzyjnusnr -dytxpkvgmapdamtc -hgocpfoxlheqpumw -twzuiewwxwadkegg -qdbosnhyqmyollqy -fclbrlkowkzzitod -sgxnrrpwhtkjdjth -xckvsnkvnvupmirv -nioicfeudrjzgoas -lcemtyohztpurwtf -oyjxhhbswvzekiqn -idkblbyjrohxybob -rthvloudwmktwlwh -oyzhmirzrnoytaty -ysdfhuyenpktwtks -wxfisawdtbpsmwli -vgmypwlezbmzeduk -rpepcfpelvhzzxzj -zxbovsmixfvmamnj -cpkabmaahbnlrhiz -jvomcbqeoqrmynjj -iqdeisnegnkrkdws -ilhemlrtxdsdnirr -fjimtscrwbfuwmpo -lmfiylebtzwtztmx -ddouhysvomrkcpgu -xtjwvzdhgnwwauwi -cntzuwcumbsebwyy -hieqvdlvnxkygeda -hushfszxskjdrjxi -xvdfzqblccfoxvyq -nldnrtieteunyxnb -vszpidfocenlhzqb -ofcuvtwhortxesoq -bwniqemqwxlejcfq -wkqiwdjnytjnomps -rbadoommlmrictte -nsmxhpothlulxivt -bvzbfcvenskqxejr -sdqeczmzpqqtqabq -bjveyzniaaliatkw -zxsqlntyjajjxytk -jkoxlerbtidsuepg -ewtlibdkeqwgxnqt -lmrshemwxrdwzrgc -nekcdyxmftlymfir -edaqvmulzkskzsfy -znmvqaupykjmyebx -ximtebuxwhqpzubd -rrlstppkknqyxlho -uyibwcitxixjfwcr -chrvoierkimesqmm -dltxmwhheldvxwqe -xfuthxjuuizanfjy -vtiwavmxwonpkpug -phchnujfnxewglht -owvmetdjcynohxtw -cbtujdrumixxatry -iirzildsfxipfipe -sqxcscqyofohotcy -sbubnekndkvovuqg -jzhsqqxqdrtibtcd -mscwasyvxkhlvwbn -bpafxtagbuxivbwz -uhvueesygaxrqffw -trrxlibhtmzuwkkl -yktkmkokmfslgkml -gfzzzdptaktytnqg -pgqmaiwzhplnbyhg -qjiptlkwfshunsfb -lewvlpescsyunxck -tywsfatykshogjas -qtrnwjjgxdektjgi -arypcritpwijczkn -jwxvngigbhfpiubf -upsjdctitlbqlnhf -lvpjlrpnmdjiscrq -jvzchdrsnkgpgsti -wuoesbwunpseyqzu -xuqspvoshgxmrnrb -icdawnmfnpnmyzof -hwcwtibgpvctznuo -bzdjrniddyamfloq -hffkxtzuazageruv -deixfxjvzbitalnc -zihsohukiqrgsnvw -nwoondfnlgowavkg -qnuulsywgnoillgn -koozejhfjyzuhviy -oetcoipohymhpump -cizwpfczfoodwuly -jghlinczhtaxifau -svjejifbidnvvdvy -rxmbsnaqhzcnbfcl -vveubmiecvdtrket -sbihpvrcnzjtgfep -iqbuljuxkwrlebvw -ptrhvxrpezqvmmvv -duwzugnhktpiybjw -lijafjnujfeflkva -coylvegferuuyfop -fowsjrgammrqkkof -pgmcruaioccmbrbz -osejwflxagwqtjoi -otqflckqgxzvtper -slwyntdcrncktoka -hzcdzsppcfkrblqg -jksdmmvtzkqaompg -galwwwgugetdohkg -zbghtjvuikmfjuef -dmqwcamjtlcofqib -zbczldlfdzemxeys -mdlqoklybhppdkwe -tuyajhkexrrrvnlb -ylfolaubymxmkowo -nnsyrfnoyrxswzxn -zkhunhhhigbsslfk -spbokzdfkbmflanz -zmzxvrwdhiegfely -imywhfczvmgahxwl -fnvabvxeiqvsarqq -yschramprctnputs -ubyjrgdzsvxzvouj -qnvdhpptympctfer -smipxcntyhjpowug -ouhjibgcmotegljy -zpflubaijjqqsptz -fgysnxrnfnxprdmf -pbpznrexzxomzfvj -thhzjresjpmnwtdv -sbmokolkhvbfqmua -sxxpdohxlezmqhhx -pevvsyqgoirixtqh -wdxrornmhqsbfznb -zjqziqbctxkshqcn -nbqcwpzfwfaahylk -bxbvkonpcxprxqjf -xplbpqcnwzwqxheb -prsakggmnjibrpoy -xoguxbpnrvyqarjl -ilrgryrmgwjvpzjy -efwrmokaoigjtrij -yhcncebopycjzuli -gwcmzbzaissohjgn -lggmemwbbjuijtcf -fkqedbfrluvkrwwl -jcbppekecevkwpuk -onvolrckkxeyzfjt -zzousprgrmllxboy -cajthmamvxuesujl -rmiozfsikufkntpg -lvekypkwjbpddkcv -dwaqzfnzcnabersa -pcdsskjopcqwhyis -uabepbrrnxfbpyvx -yxlgdomczciiunrk -ccerskfzctqxvrkz -edvmkntljlncwhax -xtcbwecdwygrvowo -axqgqjqkqwrgcqot -tyjrynolpzqwnjgj -thrtmlegdjsuofga -mpgoeqkzzqqugait -emuslxgoefdjyivl -klehpcehdznpssfb -xfgvugyrdxolixkc -acenyrbdwxywmwst -yqgperajsfsamgan -dbjxlnumrmhipquw -hsnhirmswcenewxm -qehqkbhmgucjjpwo -gprjdglsbtsfzqcw -wvqkyrkoratfmvfi -myhzlerupqbduqsl -couyazesiuhwwhht -scxzehubxhkfejrr -gqlitwfriqkmzqdd -pxtbmqelssoagxko -dzhklewjqzmrfzsw -yxgeypduywntnbji -kwzbgzhkzbgedlfh -vukmuyfstgmscuab -vcmaybfvdgwnasgt -qmybkqqdhjigzmum -cbnuicuncvczyalu -qdgpsdpdlgjasjqr -kdzxqqheurupejjo -mcatrxfchbqnxelm -badunwkeggdkcgco -ntaeanvcylpoqmxi -ghnyfytpzgvuokjn -ozepydixmjijdmts -qefcfwzdhwmcyfvp -ycyktmpaqgaxqsxt -edpizkxnsxeeebfl -uwciveajsxxwoqyr -rbvjkljpxtglqjsh -nbplrskduutrptfk -vewrbadvkseuloec -upaotnjxquomoflx -qfwxkinrousqywdd -mqzxvvskslbxvyjt -oxicszyiqifoyugx -bkitxwzjpabvhraj -ydrbyjecggynjpir -hezyteaublxxpamq -hxkuektnoovsehnd -cwtbbavnhlpiknza -qrwvkhbyasgfxwol -qryjbohkprfazczc -wjksnogpxracrbud -znmsxbhliqxhvesr -gkippedrjzmnnwkp -pklylwsnsyyxwcwg -osdpwbxoegwaiemr -kpslrrrljgtjiqka -vuqkloqucpyzfxgk -bvtdsisgvkuzghyl -qlcayluuyvlhdfyy -kbimqwnzanlygaya -nvoeanlcfhczijed -kqvcijcuobtdwvou -pmhdpcmxnprixitl -yueilssewzabzmij -zqxhafrvjyeyznyg -mhdounmxkvnnsekx -hnacyglnzicxjakg -iaxfdqibnrcjdlyl -iypoelspioegrwix -uiqouxzmlnjxnbqt -kslgjfmofraorvjo -bgvotsdqcdlpkynk -huwcgxhvrrbvmmth -vpqyfnkqqjacpffw -hpjgdfovgmrzvrcl -vbntbhbvdeszihzj -nrbyyuviwyildzuw -wckeoadqzsdnsbox -xgsobwuseofxsxox -anvhsxdshndembsd -iygmhbegrwqbqerg -ylrsnwtmdsrgsvlh -zvvejnrarsavahvc -yncxhmmdtxxeafby -kekgiglblctktnes -uoqgymsrlrwdruzc -saaoymtmnykusicw -bqvcworpqimwglcp -zbpgtheydoyzipjv -pkykzslwsjbhcvcj -jhwxxneyuuidrzvl -pafeyajcrlehmant -klszcvtmcdeyfsmj -ledsltggvrbvlefn -hubpbvxknepammep -gthxhaapfpgtilal -jtfhbozlometwztj -jrhshycyenurbpwb -fyaxbawrsievljqv -lgfcgbenlqxqcxsd -dhedabbwbdbpfmxp -mxzgwhaqobyvckcm -qboxojoykxvwexav -jcpzfjnmvguwjnum -ohpsxnspfwxkkuqe -nyekrqjlizztwjqp -thuynotacpxjzroj -wymbolrlwosnbxqx -iyaqihnqvewxdtjm -hdvdbtvfpdrejenu -gtjscincktlwwkkf -wtebigbaythklkbd diff --git a/2015/day5/part1.py b/2015/day5/part1.py deleted file mode 100644 index 869570b..0000000 --- a/2015/day5/part1.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/python3 - -import sys -from pprint import pprint - -input_f = sys.argv[1] - -result = 0 - -with open(input_f) as file: - for line in file: - tmp = line.rstrip() - print(tmp) - vowel_count = 0 - t = ['ab','cd','pq','xy'] - first = False - second = False - for i in t: - if tmp.find(i) != -1: - print(" is naughty because it contains " + i) - first = True - break - f = 'aeiou' - for idx,i in enumerate(tmp): - if idx+1 < len(tmp) and first == False: - #print(idx,idx+1,len(tmp)) - if i == tmp[idx+1]: - second = True - if second == False and first == False: - print("naughte cus no double") - for idx,i in enumerate(tmp): - if f.find(i) != -1 and second == True and first == False: - vowel_count += 1 - if vowel_count == 3: - print(" is nice because it contains " + str(vowel_count) + " vowels and double letters") - result += 1 - if second == True and vowel_count < 3: - print("naughty cus " + str(vowel_count) + " vowels") - print() -print(result) diff --git a/2015/day5/part2.py b/2015/day5/part2.py deleted file mode 100644 index 869570b..0000000 --- a/2015/day5/part2.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/python3 - -import sys -from pprint import pprint - -input_f = sys.argv[1] - -result = 0 - -with open(input_f) as file: - for line in file: - tmp = line.rstrip() - print(tmp) - vowel_count = 0 - t = ['ab','cd','pq','xy'] - first = False - second = False - for i in t: - if tmp.find(i) != -1: - print(" is naughty because it contains " + i) - first = True - break - f = 'aeiou' - for idx,i in enumerate(tmp): - if idx+1 < len(tmp) and first == False: - #print(idx,idx+1,len(tmp)) - if i == tmp[idx+1]: - second = True - if second == False and first == False: - print("naughte cus no double") - for idx,i in enumerate(tmp): - if f.find(i) != -1 and second == True and first == False: - vowel_count += 1 - if vowel_count == 3: - print(" is nice because it contains " + str(vowel_count) + " vowels and double letters") - result += 1 - if second == True and vowel_count < 3: - print("naughty cus " + str(vowel_count) + " vowels") - print() -print(result) diff --git a/2015/day5/test b/2015/day5/test deleted file mode 100644 index 6402f21..0000000 --- a/2015/day5/test +++ /dev/null @@ -1,5 +0,0 @@ -ugknbfddgicrmopn -aaa -jchzalrnumimnmhp -haegwjzuvuyypxyu -dvszwmarrgswjxmb diff --git a/2015/day6/exp b/2015/day6/exp deleted file mode 100644 index e619794..0000000 --- a/2015/day6/exp +++ /dev/null @@ -1,3 +0,0 @@ -turn on 2,3 through 4,4 -turn off 1,2 through 3,2 -toggle 5,0 through 7,3 diff --git a/2015/day6/part1.py b/2015/day6/part1.py index 6426a4b..109050e 100644 --- a/2015/day6/part1.py +++ b/2015/day6/part1.py @@ -13,6 +13,7 @@ with open(sys.argv[1]) as file: tmp += [int(i) for i in re.findall(r'\d+',line)] instructions.append(tmp) +print(instructions) size = 1000 maps = defaultdict(bool) diff --git a/2015/day6/part2.py b/2015/day6/part2.py deleted file mode 100644 index 0a46a9b..0000000 --- a/2015/day6/part2.py +++ /dev/null @@ -1,35 +0,0 @@ -import sys -from pprint import pprint -import re -from itertools import product -from collections import defaultdict - -instructions = [] - -with open(sys.argv[1]) as file: - tmp = [] - for line in file: - tmp = [re.match(r'.+?(?=\d)',line).group().strip()] - tmp += [int(i) for i in re.findall(r'\d+',line)] - instructions.append(tmp) - -size = 1000 - -maps = defaultdict(int) - -for i in instructions: - for x in product(range(i[1],i[3]+1),range(i[2],i[4]+1)): - if i[0] == 'turn off': - if maps[x] != 0: - maps[x] -= 1 - elif i[0] == 'turn on': - maps[x] += 1 - else: - maps[x] += 2 - -count = 0 - -for i in product(range(0,size),range(0,size)): - count += maps[i] - -print(count) diff --git a/README.md b/README.md index 955217f..20a155c 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,9 @@ ... ..|\..'' 5 ** . . . . . : 6 * +## 2020 + +## 2019 ## 2018