From 559f49ac56d80d0f313d223a5610bb2821086284 Mon Sep 17 00:00:00 2001 From: Alfred Melch Date: Wed, 2 Dec 2020 07:59:36 +0100 Subject: [PATCH] Solve 2020/02 --- 2020/02/input | 1000 ++++++++++++++++++++++++++++++++++++++++++ 2020/02/solution1.py | 19 + 2020/02/solution2.py | 19 + 3 files changed, 1038 insertions(+) create mode 100644 2020/02/input create mode 100644 2020/02/solution1.py create mode 100644 2020/02/solution2.py diff --git a/2020/02/input b/2020/02/input new file mode 100644 index 0000000..6cce89a --- /dev/null +++ b/2020/02/input @@ -0,0 +1,1000 @@ +1-5 k: kkkkhkkkkkkkkkk +5-7 k: blkqhtxfgktdkxzkksk +15-16 x: xxxxxxxxxxxxxxlf +3-5 j: fjpvj +17-20 x: zsxjrxkgxxxxxxxmxgxf +5-6 m: swjzmmmlx +2-4 v: vqdn +8-12 t: thllsbqtgdsf +10-17 h: vpbrjcbhnwqhhphxjk +8-9 p: zpwpppkqbpkpppp +5-6 t: wtxxts +3-8 v: vfsvhgvvhh +1-3 v: kvvvm +8-16 w: bwkqpdgwrbwjxrtqlwbw +3-8 s: sssssssbs +6-9 w: wwwwwcwwww +5-10 r: rvwrrlxbrjhp +1-4 r: rbnlkkrjphnnxpw +7-9 r: zxhrpmsrrxrlr +2-3 w: dwcvwb +2-4 v: vlvvvv +3-12 h: hbvdhhhhhqhhlzhs +8-10 t: tbgfvwbtvbnghfbhxz +4-8 m: dmvgkltn +4-6 x: xfxxxdcxxqr +1-2 p: pkcpmh +2-7 f: fkfffflf +9-11 m: mmmmbmkmmmmm +9-10 b: bbbbbbbbbz +6-7 z: zzzzzcp +4-7 c: cqccltd +3-4 w: wbvwcwllww +4-10 k: kkkmkkdkkkxkfh +5-6 x: xqftxz +9-13 r: rrbrrrrrxrrqrjrr +5-10 t: hjcxthjtvdd +8-17 c: bckccxqcmccxrckcl +16-18 b: jwxpkkmnbqftknzjkbr +5-6 r: rrrmrr +1-2 k: lkbhbkstth +17-18 j: jjjjjjjjjjzjjjjjxsj +4-12 t: tttkttttttttttttj +7-9 k: kkkkkkwkk +3-5 q: pjlql +9-14 t: tptjdnnzkvjqbthm +2-8 q: qwqqqqqqq +5-8 p: ppwwrphp +6-7 h: hhhhhtr +2-3 w: wvtfwwh +6-13 d: ddddjdmddcdkjd +2-4 k: xkhf +4-6 s: fdksdsq +2-3 x: xxjsx +1-11 b: ksbjfhgqbbbbvpcbg +5-12 f: fgfffffffffwfjsfzfs +5-7 p: ppppppq +10-14 z: zzjzfzzzzfzzzj +5-9 p: qxxmkfpspnpk +6-7 s: shqgnsq +10-15 v: vvvvvvvvvnvvvvvv +1-3 g: gxchngg +5-8 v: vvvvvvvcvv +9-14 s: sssflshssssssssssfs +4-7 v: kvlvdkvfn +9-10 x: xxxxxxxxxdxx +3-4 n: nnnnn +3-7 z: zzzzzznz +2-5 v: hnkgvxqqfq +3-9 m: vmbmbqrmks +5-8 g: ghggggjfggfd +13-15 m: tvhsdwphwtpkmlm +14-15 h: hhhghhhhshhhhch +15-18 s: bssssssvssssjszsss +6-7 h: hhfrhhmhhh +5-10 x: xxgxxxdxmmxrx +2-5 c: cztcgcwct +2-4 l: lllw +12-13 x: xxxxxxxxxxxgx +4-5 k: kckgkk +1-3 p: gqppndp +4-6 c: cdcnfr +6-7 v: vvmvvvfv +2-4 c: cdzc +7-8 x: xxxxxxxxxxwxx +2-5 z: zzzznns +6-7 k: kkkkkkk +13-15 t: ttttttftntttttxttttt +4-5 k: mckkmkxthk +3-6 h: hhchlhh +10-14 x: xxxxxxxxxsxxxxxx +1-2 n: nknnnz +1-14 r: prrrrrrrrrrrrrr +1-3 p: gpppp +1-15 x: xxxxdxxwxxxxxcxr +9-10 f: fffffffffk +4-5 m: mmmwmm +10-14 q: dtbtqwkspvxbtq +4-7 w: wzsxmpqgxjwsw +9-16 z: qftzzzfztnczwzzzjzzp +6-11 r: grrqvcjkhrrdrsrrrqr +8-11 g: gjbmwgggbgnggltgz +5-7 c: cccctcdcc +11-13 j: jjtzdlfrvjcjsjj +3-11 p: wmmrmblfbcppjvvfp +2-3 m: zgzrsf +9-13 t: tttttttttsttttt +2-4 m: skmm +3-4 l: nllx +5-6 h: hhhhhx +7-9 l: mlflqllgl +6-7 r: rrqcrnrlrrcr +1-4 x: xbxbbcxx +11-19 f: ddfzffnfffqffffffff +2-7 w: wtwwwthw +10-14 z: zzlzhzzzzkzzzzkzzzr +10-12 p: pplvpppwpnqpprspspp +12-14 g: gxghmjgggggjgggggg +4-5 w: whlmwx +1-10 g: cggzggbsgzr +2-5 p: ppppzjp +4-6 b: bbbfbbbbxbbbbbbbbbb +12-14 r: rrrrrrrrrrrhrr +9-10 f: fvdkjxfgpf +4-7 v: vvvnpqv +4-14 r: rrrwcrxrqmrrrrrrrrr +10-15 z: zszjzjzzmzzzzzd +8-11 v: vvvvvvvvvvv +10-11 v: vvvvlvvvlrvv +4-7 j: fbbbhjjj +1-5 d: ldddd +2-5 p: flkszkmgp +4-11 h: gclqbxbphsj +2-4 h: jthhhh +8-9 f: fqfffgfqfffffff +2-9 v: znfvsxrdw +12-14 c: cccccccrccmhccc +2-5 k: tkwkk +3-4 f: ffqffff +3-5 j: jkjjm +7-10 t: kvggzgqjttrg +8-17 h: whhhhhhhhgvhkhhhs +2-16 s: spsssgssssssszsssvhp +6-7 s: jssssbk +7-8 f: fhfffqfn +6-12 q: pmfgxqdcwsnqvfpbxqt +2-3 x: khqxfx +4-11 z: rzzzzzvzzzz +2-4 x: xrsx +3-13 g: ggggqmggggggglg +2-4 c: vccs +3-4 s: szvsfs +11-17 x: csxxxzxxrkzqxxzxxxbx +13-16 h: zhjhhhhbhhhfshhhqhh +16-20 s: zjljhcpwdzgbkdsssgrs +6-7 t: ttqtttbxtt +3-4 w: wlswk +8-9 l: lllllglrllll +8-9 d: ddddddqdnd +8-10 c: cccccccccbcc +2-6 n: fnxlng +6-10 g: gggggggggt +4-13 p: pmptpjpppkpppvpp +12-13 b: hbwpjmnxcwvfl +7-10 c: tccccclcccc +16-17 n: mnnjnmrnjnnnnnnnn +3-4 r: wxrr +9-16 x: xxxxxxxxxxxxxxxnx +1-5 v: vxvgm +7-11 l: lllnlhllnlljcll +4-9 s: sdhtjsdfsstl +9-11 n: nnbszpzwkmf +15-16 k: kpvfgsrkptkkbdkj +3-5 j: nfrjffxjh +6-9 j: dxrrhnwwjm +9-10 x: xxxxxxxxpxx +3-4 n: nndnnnnlnnsnnnnn +2-4 n: mgnc +16-18 g: gggggggggggggggggsg +8-19 p: lbmcxkxfhwltkbjzppp +6-8 l: lllllllbnllflz +1-2 g: zggggg +10-12 n: vxddjhnnvnrr +1-3 f: sftff +12-13 q: qqqqxqqqqqqqcq +1-3 r: trqrrrrrr +5-15 g: ggggfgggggggggdggg +5-6 l: zpzcklk +3-8 j: jjcjjjjjj +11-15 k: kkmkkkkkkkljkkk +3-4 x: hxdb +8-13 g: vggggfgdpggghmg +6-9 q: qqqqqcqqqqqqqqq +5-6 z: zzszbz +8-15 k: knfkxkzjvbqqdkvc +13-16 n: xbngntvnqdnfnnfd +1-9 s: sshstsssv +5-7 s: szsslsss +5-7 n: nnxhdfnnr +2-5 m: mfbdm +10-13 l: qnzhxkkwflllrllz +4-8 h: mnhtnbhxw +4-5 b: wbwbp +4-13 s: jttsbbszhssvt +8-12 r: rrrrrrrhrrrrr +3-6 w: sxvnksbvdwlg +11-14 x: xxrxxxnxbxxxkx +16-17 s: szssssssssssssssc +5-8 l: hlllclllllllllllll +3-4 l: lllhl +3-12 s: ntsmzknclldtlsq +5-10 m: mmmmmmmmmlmmmm +7-10 x: jxkhxkxbbvlmn +4-6 t: tttttwt +18-19 l: nlbllqqvqqlmpllxldc +1-2 m: mpmmmgqm +3-7 t: ttfttqgtttttt +3-6 r: brrrrfrt +9-14 d: sddddddxdnxddzdd +5-6 c: szcxsc +3-9 m: cprvpmmmm +12-16 p: ppppppppppptpppp +3-7 q: qqsqqqbq +2-11 g: bgndtnltsgg +5-6 c: kctccckcxcc +8-9 q: qfzbfnbjzljzcvhpswgt +17-18 j: jjjjjjnjjpdjxwjqwjfb +2-5 g: dhkldg +4-6 s: rwssbs +11-12 g: ggmggcgpgmgn +1-2 f: flcnv +10-11 c: ccccccccccrc +14-19 h: hhhhhhhnhhhhhbhhhhhh +9-10 v: bnvvzctvvw +3-7 v: gdhvpqv +6-8 c: ccnccfcc +6-9 j: zjdjlfnjjjjnfj +8-9 q: qqqqqqqfq +12-14 t: ptgsttgttttttkttst +9-12 p: ppzppppkjpppqppd +3-4 g: gggfggng +4-9 z: zzzqqdzrrzzz +5-7 f: bjbftff +12-13 w: wvwwwwwwwwwmwzfwww +1-4 h: htnd +5-10 m: nlbtmgfmpqzfv +11-14 j: jcjjgjjjfjjjjzjfj +9-10 n: nnnnnnnnnznq +3-5 t: ttttmt +7-9 n: nnntnnbnnnn +7-14 l: btlsjhlgglhrlkllgrb +4-5 g: hctgg +4-6 b: ksbbjbljnfsd +2-3 h: hhsx +4-10 h: pgmhbbhmpsvxnhdtsh +5-11 q: pqrsdqqqqqqqq +1-4 s: sssq +6-7 r: shpvlsr +1-2 f: fsff +8-14 z: zgzhbwkzdjtglgxzh +10-14 j: djjjjgrgjjjjjkj +2-12 g: ggxtdhcjpfdg +1-2 f: frfffffmffft +18-20 d: ddpkddbzdkdkxzddhrdx +4-7 b: bwdbrbkq +8-10 d: dhddddddmt +7-9 z: znzzzzzzt +4-11 r: jtcrcsfjrkrfnttm +4-5 k: hkkkkk +3-19 m: vtxnccshqhlvfkwrxtnw +8-9 h: hcvhghzfhrhh +5-6 r: bqdcjrkrrwqvrr +6-12 r: rprmrnrfkbrrwm +19-20 f: fffffffffffffffffgff +6-8 d: dmdddhddd +4-11 w: mwwwwdwkwwfwww +9-10 r: rrrqhvfrrhrftrprr +9-11 p: ppppdpsghpp +2-5 m: mmnmmtttwvk +6-10 q: qlfqkqdbqb +8-9 r: rrrrfrrrprrrrrrfr +4-6 l: nwnklltxl +3-7 b: fzvpjtbjb +3-7 r: rrsrxzrbrrrqx +2-4 n: cnbg +6-8 t: ttqtttfjhtxtgdrtn +4-5 g: gghgggg +7-10 s: rgdqsqstvwl +4-11 w: wwwsjwwwbwjwwww +3-6 q: qkpqhfqq +3-5 l: xbhmlrlllvq +6-7 v: gltvcvkn +3-4 t: ttthttt +11-13 n: nnnrdndnngffnnnnnn +1-4 t: nttvt +4-6 h: hhhhhl +4-6 l: rlgmlqmtlptdf +9-16 x: bqkxsfdhxlhwmzrqn +9-10 m: mmmsmmmmmvmcm +4-6 b: bbbbbd +11-15 g: ggggggggggggggng +1-2 v: bvvssfblvnxqp +5-6 v: pvtjvpvvv +1-4 c: cccnccccccccccccc +8-11 s: sssssssjsxxsss +5-8 d: ddddgddd +6-13 z: jxzxzzhzznzqw +6-12 r: drzdgkrctcnd +11-12 k: kkkkkckrkkkwbtbkvkk +16-18 t: swtvgprhjnzlgsjjst +5-11 k: kkkkkkkkkkpkkkk +4-7 j: jjjjjjjjjjj +6-8 d: kdddkdtt +1-5 c: cccsk +10-17 n: nnnnnnnnnrnnnnnnfn +5-9 z: zpzznzzzzzvzzzzz +5-20 t: tltttztnttttttvtttct +2-14 l: lrlllllllllllll +1-12 h: hhhhwhhhhkhshh +2-4 p: spbpppkppnjfx +11-15 d: ddddzdcdddddshdw +9-10 h: qhcwgthzsh +2-4 t: bhdtttbfwjpthntmrq +3-4 z: jzdz +7-16 k: hkvxwzkqrkbsltgcx +3-4 v: vcqv +2-7 x: xdtgjjxfh +15-17 c: ccnzdlcpzrccbcccf +3-7 g: zsgrmgrh +3-7 z: zqjzzlzcvzzzls +6-9 f: cnzdlfnqvzkq +2-5 m: jmfhgwmmc +7-9 r: rrrrrrrws +4-9 g: gdsgggbkdgg +11-13 l: ztrzlltljglzcr +10-13 g: ggggdjgtgggzrgg +12-16 k: zpfdzxwbzfkptwqkn +15-16 p: ppppmpppppppppwpp +8-14 b: bmhgtpdbbsrkbgvwd +10-12 k: ktkkkkkkrnkjkksk +2-10 d: dhdwdffhdqngs +4-7 g: ggglggggggggggg +1-10 f: xfffffffffff +6-11 m: mxmnvsmwmmmww +15-16 k: qskxqzknqkfhtlbkhx +4-5 b: hbbbt +11-14 k: kvkkdkkvkdskrkk +1-6 b: bjvbqs +2-3 r: dxzsvqtqvxrbv +6-8 c: cscrxrcklcscvkmbccc +4-8 d: dddjddddmd +4-13 x: dprmsnhxzxnxmv +5-6 j: jhkjjz +5-8 z: mzzjzhzbwdzl +9-11 x: xxxxxxxxlxx +4-5 d: dxdvndddpddddddddvnl +2-5 v: vvvvlv +5-11 m: cmmgmmmmmmmmmtc +13-14 r: rrrrrrrrrrrwjrrr +4-14 w: rlvwwwglzlxggwhkhk +17-18 d: dddddddddvddddhddldm +3-6 r: gmrprm +5-6 m: fpmjlmmzjb +12-14 j: jjjjjjjjjjcjjq +12-14 f: ffffwfffffbdfq +9-10 j: jjjjjjjjbjjj +1-3 z: dzzzkz +1-2 w: swtcxgdqgnlj +1-2 v: wvvv +1-3 h: rhrr +2-6 x: wxxmtbmcsr +6-7 d: ddndtfdd +8-13 j: cjqjjwwhjcswbthcj +3-4 x: xhxxppxnwmwkhdx +7-9 j: ggrjjbjjjnjvjjj +3-9 g: tzghddllprgs +11-13 r: jhdvbchsrzlxrwjrz +12-13 g: gwgggggggggglg +2-14 m: kmmcwwhprtskhwwvg +1-4 r: rzrssthbbhjdmnx +5-12 f: ffffgffffffff +19-20 j: jjjtjjjjjjjjjjjjjjjj +5-6 n: gnfnnnn +4-10 b: bbbmbbbbbbbbb +1-2 x: xsxs +17-18 r: rjrrrrrrrrrrrrrrzr +12-16 b: bgpvgbkbkhbqwbvbtbvg +1-11 q: qqqqqqqqqqxq +8-11 l: lllllfllllgll +3-4 h: hrtc +9-10 l: llvllnllkbwlslldllm +6-8 j: jjjjzsjj +3-6 n: mnxqjn +2-3 g: ghgg +2-16 q: qkqqqqrqqqqqqqqqqqqq +2-6 n: nnngrbfqshlmnnskdwpw +4-13 f: fffffffffffffff +4-5 s: nvcstplm +7-14 n: nzcnntnsdnbnngnnnpnk +16-18 v: vmvvvvvvvvvvvvvcvv +5-6 l: llllhq +5-10 d: ddddddbddqd +12-14 h: hhhhhhhhhhhzhhhh +11-12 b: bbbbqblbbwbnbbblbt +3-4 n: nwnqbtn +6-10 v: vgvvpvvdvbzq +10-11 m: mmmmmmmmmmmmm +6-8 b: bbbvjpvb +5-7 c: rcccccs +5-7 n: nqjksznntnzgnznmjj +7-8 r: rrrrrrrfrrrrrr +7-10 c: ccmccszccsmcbccggclc +1-8 s: sssssssxs +3-8 j: jxjjjxjj +7-10 z: zzzzzzczzzzzz +1-4 g: gdzgg +8-9 b: sqbbbbvhb +16-17 s: clssssssssflvssss +10-11 h: vhjhhhwhhpsh +3-5 z: jczzmzz +1-8 p: cztfpjcpp +4-7 w: twwprwwcww +2-3 x: xsxx +4-11 m: mswmmdkmmmqmwmfnqmt +8-11 b: lpbbbbbbbgb +4-14 n: nnnnnnnnnnnnnwnn +5-7 m: mrxsvmnwbmq +3-4 w: wwtjw +4-5 x: xxxxsxx +7-10 v: jkxhvtvfcvcsfvrbczkv +6-8 v: vvvvvtdvfjpc +11-12 h: hxqhhhhhmhnh +1-3 h: chhh +4-9 n: nnncnnnnnn +14-20 z: zrzzhwzmtzfktvrwqzxq +11-13 j: jkjjdgjjvpjjmkj +3-4 n: rcrfknnn +3-8 c: ccsccrccc +10-16 n: nnnnnnnnntnnnnnnn +8-13 p: tpvzplvlppphpzppjp +3-5 r: srrrsrhr +18-19 g: gggggdnfggqgwgggsgpg +13-18 m: mcjmmhmsvswcrmkmmmm +3-9 p: bjpgzprcplf +6-9 g: ggkgsgggj +1-7 v: vvvvvvmzv +6-16 h: hhhhrhhhthhhhhhq +2-3 v: tfvq +1-9 v: svvbwcvvvvl +10-11 d: dfdddddddhdddd +7-9 v: sscbdsvvr +3-6 q: wvrrvqrqczg +7-9 v: gmqzvpvbvd +2-20 v: tbmpjzvhqbklqtsllcfv +7-11 v: vvvvvvvvvvv +11-13 s: kknsbrcpsjblhrsbkh +2-7 n: fnnnmpstcklhwzmwx +6-14 d: kdmdhlddddddmv +17-18 z: zzzzzzzzzzzzzzzzrr +2-4 k: hmkfkklq +11-14 n: nnnnnnnnnnznnn +6-10 k: hnvpcckbxkpks +1-5 d: dmdpvjgdcglnssx +6-9 k: xzhqkpxvkkdtskkkwk +7-9 p: ppppcpppppp +4-5 r: qnvrrhvshwrsrxc +8-9 l: lllllllzk +9-10 s: sssssssssks +8-9 d: ddqzdddsd +4-16 k: kkkkkkksfwkkfkkhkk +10-11 n: rtpdqfmrnknr +5-6 z: zfzzztzxzzv +8-19 f: hvtkcwpfdgqwwqfwwvvb +5-7 v: vtmvtvwd +1-2 s: hpsp +10-12 d: jddddddddddc +8-10 s: tvsxfdgjts +6-7 x: xdbkbjxd +3-16 m: plmmxkwpcjgqgbrm +2-7 c: bqrdnscbkc +2-3 m: mnpmshpnqwz +4-7 g: kngcjgg +1-5 l: llllcl +4-11 k: kkkrkkkmkkkkkt +8-9 t: tttstvttsttt +11-12 c: cxzcjcccclnt +1-3 w: wwpss +2-7 p: zpsmqpx +4-9 x: whdsxdmncxwplxbh +17-19 p: qpqpppjppppfppppppp +1-2 b: bwbwxrbgb +5-6 n: nnpnbhpn +5-12 m: pmmmsmvmmmmmmm +5-9 q: vqpqqqqqbqqqfs +12-15 m: mmmmfmmmbmrwmmqmm +1-5 w: wtnflwwr +5-6 j: zdhhnrqpbcjkj +9-16 r: fmrzrrrrrrrrrsrfr +2-3 s: dmsq +1-18 w: wwwwwwwwwwwwwlwwws +2-9 c: cswcrbrccccqj +15-17 m: mmmmmmjzmmmmmmmmhm +1-9 n: nnnpnfkxnnlrpssnxbv +7-9 x: kvgqdhxhxvbm +5-8 l: ljllmclllftjzqk +9-12 j: jjjjjjjjjjjkj +12-13 h: hhhhhhhhhhhrh +11-13 f: ffffvfrfffmfff +3-13 n: dhnnndnnmwndrnnnhnnj +1-4 w: qswww +11-12 r: rjrcrrrcrrpkrr +1-5 k: kkkkjbs +3-4 r: vzrr +2-3 k: kmkkkkkkkk +3-4 v: vkdg +2-5 j: vtjpv +7-10 t: ttttmttjntqttz +2-3 x: xkzxxt +4-7 w: qhwzvswkhw +1-2 l: wqwnl +6-12 r: fzrrhrgrrzfxr +3-4 d: dddtdfbddd +12-16 g: gggggggggggcgggg +11-14 h: hhhkfhcshhchhhxhhhh +1-2 f: zfff +6-7 z: zzzzjgzz +12-19 k: tkgkkkkfkgkxgkqgkkn +12-13 c: ccccccccccczcc +16-17 z: zzzzzzzzzzzzzzzzn +4-5 b: bbbpbbzbbb +17-18 c: nvfkfcwxxjlrrslwcpc +7-10 v: kwcfvvvxvx +9-13 q: qqqqqqqqqqqqwq +1-4 g: pjgdhgnmzggd +7-11 d: ddddddzdbdd +17-20 j: npdnjjjjjjjjkzcfjslf +5-10 q: zkthrrkzqg +6-14 j: jjjjjjjjjjjjjkj +5-10 t: tbtttfbmztq +3-4 s: sssv +6-8 w: wwwlzwwwwwdk +1-11 l: vffmrflltflkwxldl +8-10 j: jjpjvjjjjb +6-7 p: hpqhvpzpphdkpp +3-4 m: mmtv +9-15 l: lllllgllllmllll +10-12 m: mmmmvhmmmmgtvg +2-6 w: wwwwwgwbt +7-13 m: mmmmmmmmmmmmm +1-5 r: gjcskhrz +5-12 s: bvggstbnhjfdfwz +7-8 c: ctxcfppcccc +12-14 j: jjjjjjjjjjjhjp +14-17 t: ttxttttptttttttttttt +1-8 l: lllllltf +7-8 r: qrrrrrrsvrhm +1-13 q: qqqqqrqqqqqqgqqqsq +4-9 n: qpnmnzpnnnnmxtr +6-11 z: qczxzzkzbkznzrvnvkz +7-13 b: bbbbbbkbbbbbsbb +6-9 c: ccfqncjszc +1-5 l: lrlsl +2-8 f: pfbtbvpjmzwpccsbm +2-4 d: wnjd +10-11 n: nnnnnnnnnxndnnnn +3-4 c: cccc +8-9 r: rflrrrvrh +3-4 b: thbs +3-9 q: zcqqbdrws +1-6 d: dlmncvgd +2-3 n: bmnfknkt +9-13 n: nzbpvpmfnwdnn +7-14 f: wpntqfsttpvflf +13-15 w: cwwwzspwwwswwlxp +4-7 j: jjjmjjj +10-14 m: bnrnlmhdfwnhfmdc +2-4 z: kzntlwtbzx +11-13 w: wwwwwwwrbwwww +6-7 g: pwggggv +5-9 h: sbdxfjffznxghlwtc +10-11 c: ccccccccccpccc +2-4 h: hnhbc +4-5 z: fjblqlpdwbl +1-5 d: dddddd +6-7 n: nnnfjnlvnxvnnn +4-5 m: mmzvmm +13-18 w: nxxwkwbwwpzgwwkwwfww +8-9 g: ggghkwbgc +9-10 v: vvhpjzvvvvfcnlvvgvq +1-15 k: kpprkqmkthtkwvd +16-17 b: rrhdbfwpntvjphvbb +16-19 k: kkkkkkqknkkkvkkfwkkk +5-9 d: dwddddddddzd +10-14 g: gggggdgggrgkpzgk +9-12 x: bffxxdjwsxcx +3-10 b: nbgbzbbbbbbbbbbdb +15-17 x: xxxxxzxxxxxxxxxxt +1-5 h: xhthhdq +5-16 j: spfjjmjjjjjjjjjjjjjj +3-6 b: hzbbbbmbkdrb +11-13 m: mwmmmmrmmmmmmmmmm +16-17 v: vvvvvvvvvvvvvbvvv +17-19 g: ggggggggggggggggggg +2-3 h: gfhvhjwh +4-6 f: fjgzwf +1-5 x: kjwhxntxhxfcxlfgb +6-7 s: snssplq +7-13 x: kxgxxxxxmxglhxx +3-5 j: ljjvdhp +13-14 c: gjtrlcblfbqvcw +13-15 k: kkkkkkkkkkkkkkk +5-8 t: vtfvttttmszk +9-11 q: qjtsqqqqfbq +3-8 f: fftfrvfcfqfff +6-8 f: fffffffdf +3-8 l: lhllwvlltzlw +7-14 p: hpxrnnbpqrcjtpvjpgq +1-12 z: lzzzzpzgzzgz +4-5 c: ccgqcnc +10-11 x: tpmddsxqjdx +8-10 p: pnpfppppqpcpf +1-6 q: qqzkqh +1-4 g: wggc +16-17 f: fffhfxqffftfffffhf +7-8 c: dcvckvbc +7-12 z: zzkzzzhzzjvz +2-12 z: dkghplwzdnpzq +3-4 r: gdkvhr +3-4 t: ttbx +8-13 s: sqzsssstsgssslsss +1-4 s: csssss +5-7 j: jfzjjvjjkjzwjrjtjw +2-12 s: sgcssssszfqsssn +8-13 p: pzlhpxpsphppz +2-12 m: mllzwvmzkgbmns +17-20 k: kkzkkkknkkkkkkkkkkkh +11-13 j: jxhqjjpwjljjj +17-18 z: zzzzzzzrzzzzzzzzzl +2-7 c: vhrqfckjrh +7-11 p: pppppnpppppj +9-11 x: xxnxxvxbxxxxgrxmxxw +12-13 h: psltjhhhvmthh +1-2 q: hsxqqlqxwqm +6-14 b: bzdnbblbbsbbnbb +3-17 z: wlwfbbxnztpvfgdzzl +5-6 z: zzszzrmkplrzz +12-14 z: zzzzzzzzkzzzvvmzzz +16-17 x: xpxxbxxxxxxxxhckxn +6-11 w: wkwhmgwwwwwwwww +9-14 f: ffffffffzffffff +3-4 q: qqjqsq +13-14 z: zzzclzzzzrzzzzzzzz +1-3 x: xxxxxxxx +9-11 w: wvwrwwwdfpwwxwdw +2-10 s: zssqsxqqtm +3-10 b: bbbbbbbbbxb +4-7 l: llllllb +10-11 j: jjjjjjgcjqjjj +12-13 t: tttsptxtttttvbktmt +5-6 z: zzzzpzzzz +10-11 q: qqqqqqqqqhq +6-12 w: drkfkwwwnvccmxdfwx +3-4 h: rsht +10-12 m: mmjmlmhmmmmnm +4-6 s: sssssss +2-3 z: mwccbpff +2-16 t: tzttttttttttttttt +1-2 j: sjjjjjjjjj +10-11 b: wbbbbbbbbbdbwq +6-9 r: rngrdrlrvmrbrr +8-9 t: hplttzttt +18-19 v: vvvvvvvvvvvvvvvvvck +11-16 p: pxnnsvpmfpxvbpnpppc +9-11 b: bbhsbbnbwbbbbwvbb +6-11 r: rmngrbbmrwrprjwrr +5-7 p: kpjlppjp +2-9 m: mtmmmmmmhm +1-3 l: llknl +5-6 s: sssssvs +1-3 v: vvbvvvvvvvvvmvvvv +3-4 f: ffffff +10-12 w: gjnwbwwwhdww +10-13 w: wwwwwwwwwkwwww +3-4 r: rrrrrw +4-5 n: nlnnm +1-15 b: bbbbbqbbbbbtlbbbb +3-4 l: glgl +4-5 k: bkkkkkk +2-8 j: dwtxvrdj +6-10 x: mwrznjhznxxx +14-15 d: dldddddddddddddd +4-14 s: rsssszsnzscdhrgp +1-8 m: kmmmmmmxmmmmmt +4-9 m: svkmmdmxm +2-7 f: fpffffffff +8-10 h: scpsvhkhjcp +7-11 x: xmzxxxxxxxtxxxx +13-14 p: dswdpggstpqjpc +8-14 j: jdjjjjfjsbjjxwjjbjj +3-6 m: mmlmmqkwmmmmmm +4-5 k: kkkpkk +2-7 t: tbttzxtm +3-5 n: jtnrlnbjnkztvknwnj +2-4 r: rrrwfghwrxpg +7-9 f: cffffffff +4-6 l: cmdsllz +2-4 z: rzzr +2-3 r: rzrrk +2-4 d: rddb +5-6 d: pvdddwdgkgdx +2-3 j: sjvfpftdkjkfg +5-6 s: vzdmgsk +13-14 d: wdddddddddddxbd +6-9 l: llllldcllll +3-4 r: rrjrn +7-11 f: ffffffffkfj +5-8 p: pxnmcppspxp +8-10 l: vplxllngbdl +7-18 w: wwwwwwwnwmwwwwwwwmww +2-4 x: mxxx +4-13 g: nnbxkmcrgpskgqg +3-7 l: llllllz +5-10 h: mgksbvscjbcfrmhgplw +2-13 g: mbgphwnkdndsg +15-18 x: xxzxxxxxxxxxxxxxxxx +1-3 x: xxrxxx +10-11 l: llslllllllp +1-5 n: nnrnpnnn +4-5 h: rhhlv +4-6 p: fvkrppswpdpp +5-12 d: dlrkxwdxgdjdwj +11-13 j: jjjjjjjjjjjjj +9-10 w: wwkwwwwwwvw +3-4 p: xzpjwvzmkppsppjz +3-11 r: vtrhfmdhpsqrrbwrlmc +8-15 d: hdcddddqdwfdddtdddd +2-4 d: mdkt +11-18 k: kjbtldlkfndkcbjsrk +3-14 h: hbhjlhlhhhvhhqh +4-6 x: zlkxxfrxmsl +7-8 g: gmmgtqgknbqzg +10-12 v: vvvvvvvfvxvvvv +7-11 n: nnnnnnnnnnc +2-5 t: btqcb +3-4 j: kgjsjvj +4-6 h: skhnbt +1-6 x: snxxxxxx +3-15 c: hccccjkbnctnxcc +12-17 s: ltsssshssqstssxsk +12-19 r: rkrbrrrrrxqcrrrggrsr +6-8 p: ppppprpjp +4-5 v: vvvvvxsrv +3-4 k: gskskzwmwfltkkgzxllz +3-10 h: qmvhhdqthhhshthhd +4-6 q: qfjklq +11-13 f: fmfffffffffhh +8-14 s: vlqlskgsjvgmfhgvzfft +5-8 d: dbrdwdkdddddd +4-5 b: bbwmr +18-19 d: cddsddvrddndwdpddgdd +4-5 l: llsls +4-6 h: mhszhh +15-16 g: gggggggggggggzggg +2-4 x: bxcxwflqrnrrrb +3-17 s: xhgvmzncgctsqdpks +4-18 p: rprpfcxprrmncmmwqj +1-2 v: vzvwvvvvbv +8-9 m: mmfmmhvbq +10-11 z: vzqjzzlzkzv +1-4 r: rrrsrn +3-12 k: kctvqmgbbxskbww +1-6 s: fsssgmsqss +5-6 k: kkkkkv +1-7 m: mvmmqmq +3-8 b: skbfbwhbbgwfcgnmjsk +7-9 s: sssssslsn +4-6 n: nnnnzbnn +2-4 x: kxnnqrvxtgch +13-17 w: xshwjqwgsnwrwwcww +12-13 l: lllljlwllllllll +2-3 k: kkkk +16-19 s: sssssssssssssssmssss +5-12 c: cfccpccpccchccc +9-13 j: vjjjjgjljhjjbjjfj +10-14 r: jrrrrrrrrkrrrrrvrr +6-10 b: bxbbkbbbbn +17-18 f: tvxfdgwgfgjdsqcppqkq +11-17 m: mmzmmrmhmmpmmmmmmm +8-9 v: vvrvvvkvkvv +3-8 g: wgcgpgghgpgdggfx +5-10 r: rrrrgrrrrk +7-15 l: sllnpklfqllglld +1-2 z: wzzwg +9-10 v: vvqvvvvkvbv +2-8 s: sljssddnsscsns +4-5 g: snzgpngj +1-6 c: ccccgtclgqchvcx +12-14 n: nnnnhnnnqpnpnnnn +11-13 p: wpdmppdpppfpp +3-11 b: bjbbndmbbbnbbbbbbb +9-13 x: qxxxxxxxkxxxxxlxxm +4-6 p: pqpnmp +1-5 j: jjckjjpmjbcmc +4-6 q: qqsdqqkkqdqg +7-11 l: qslplhlvqxqm +14-15 g: vggggvggpggggprggg +6-7 t: ttthtttttttt +2-3 g: qglgg +11-14 t: kdjwqgbtnzcdltt +10-11 c: cccclccccck +15-16 r: rrrrrrrrrrrrrrrh +5-7 m: vjbfbcxxdwxcgrfzmzhd +6-7 t: tttzftmt +14-16 n: nnnnnnnnnnnnnpnn +4-12 s: rgmktzvjlwssx +8-12 v: vvvvvvvvvvvsvvvbvvvv +2-3 w: kvwqmw +12-13 s: dlqsssssmvfskss +7-8 k: lpkfkkklbkkk +3-5 f: nvftfntf +5-7 t: qtfkhtxttqctmttvc +11-13 b: blbbbbbbzhvbb +4-5 w: wwwwxs +11-12 n: nnnnnnnnnnpnnn +11-16 t: ttttttttvtkttttnt +12-16 j: wjjjdwjjmjjjjjjd +5-6 q: bqqqvq +1-2 s: kssx +1-3 j: qmcj +5-10 v: ckjtsqsdvvvhctvfvhkv +5-8 l: kllhlrlzljll +9-10 j: lgvgjbccjrn +4-5 j: jbhhvjbcjggjhwx +5-6 m: mmmmqms +3-7 v: hvpvmmt +5-9 z: zzzlbzzjzrvxvkhxhzdj +3-5 f: fkfmknbzmwbcmh +8-10 n: nvjnklncnnp +4-10 p: ppptpfpppgppp +14-17 z: zzzczzzrzzzzzzzzncz +1-5 w: wwwwlwh +19-20 q: wzrqqqdmqqqzqqqvqqqq +2-4 f: tflf +4-5 t: tjqtltrtf +17-18 t: ttttttttttttttttdtjt +6-12 s: mhfslsfndcsvkr +7-16 r: rdprghmtcrrmrrlv +12-13 h: hhhhhhhhhhhph +12-15 k: kkkkkkkkkfkkdkbnk +16-17 h: hhscfhvhxvklqshhhmh +1-7 w: whwwdwwdz +2-3 b: bbpbb +8-9 n: frnnnnncmn +2-4 b: hbpbpsnj +11-19 f: qhggmffvmfjptmksfvf +8-10 b: rbbldmcbbxb +1-3 t: tjxfsmmttw +3-5 v: vvvvdvvvn +5-8 m: jmhmmvmjkx +7-9 x: xxkbxxxvxx +10-12 f: ffrffcfxnffrnfvffff +6-8 t: sttghztn +2-5 l: cmrllltb +8-9 f: sskbzzxgfhvc +4-7 k: kpkljpqfkkhkfkk +19-20 r: rfrrrhmrrrnrrtvrsrrr +3-4 x: sxxzn +5-7 k: zlkgpwk +3-12 k: drqkqbzgkhqkqb +3-4 g: qgfg +3-4 z: bkfx +6-12 f: bffxfnkfffgf +3-12 n: xhrlptrqvzfnmptvtjcb +4-6 z: kzhzrp +1-2 n: ngnnnknjnnn +7-9 n: nnnnnnvnnnnnnnn +10-12 s: sgssssmssssss +2-11 l: lmlllslthwlldn +13-16 b: bbbbbqmbbzbbbbbhb +4-6 p: pppbpp +2-6 n: nnxnpnnn +9-13 b: bbbbbbbbbbbblbbb +11-13 h: hhkghxdhfhhdkchjr +6-10 w: wwwwwhwwwwwrpww +6-7 w: mgpwwsw +10-11 n: njnnnntsnfntcqnnn +7-9 f: ffffffrfng +2-6 x: xxjgxnqxxkqf +6-11 n: nwnfvzndsdnn +16-18 c: cgccccccccccccxcct +11-17 t: wtktgqtcpttqkqfgznt +4-5 w: wwwwc +2-5 k: gqkck +15-16 k: kzkkkkkkmkkkdkkpkvkg +3-4 s: cslss +1-8 w: hwgwwwwwzsbwfwwwg +7-14 m: hrkqfmpfzmjqqmmgrdcm +2-8 r: sqrrrrrr +11-15 l: cphdwnphlkcbvllvw +4-7 f: vsxgfnf +8-10 q: qqqqqqqtqq +6-8 l: llllzqlll +9-14 j: kjjjjjjjvmjvjz +4-6 x: pxxxbx +10-16 h: hkhjhghhsghhhhhhhhhn +8-10 x: xchbxtgxqrrxvmzw +18-19 n: nnnnnnnnnnnnnnnnnnn +1-12 n: nnnnnnnnnnnnn +5-12 l: xmklnkmpqlfllwhrm +6-7 b: kfhbpbvbfbpbbtsxk +8-18 n: nnnnnnzznnnnnnnnnznn +10-16 h: hhhhhhhhhhhhjhhchh +12-13 l: lnlllllgklllx +5-7 x: xxxxlxxxxxx +3-4 g: gggn +3-14 g: gjgxgcggvdggggqgngqg +9-10 g: gggggggggt +3-6 r: rrntrrrrbrs +3-10 g: ggkbdgggkgg +3-4 k: twjqtkt +12-13 m: mzvnqmmpcbvmk +3-8 p: wxflqbvppqq +3-6 w: ljdlfwkzwmgkwxghbqv +11-15 p: nplwjprspcppvsvpfppp +5-16 v: vqvcmvjvnvvprvnqvnpc +10-11 g: ggggggggggng +13-16 b: sbbbbxqdbdblrbbbb +1-4 k: czlk +6-7 f: rffffsff +8-9 w: wdrnwtqmwqdpx +2-3 r: rxrr +3-4 r: hrrmrvj +10-15 v: cvffvvsvvpvvvnvvgjvv +12-19 b: bbbbbbbbbbbrbbbbbbbb +3-5 n: nvnhz +2-4 d: hddl +2-3 v: fvclhvp +3-15 h: xwhsnhndxgcqjfqtvm +1-3 h: rhhhh +15-18 f: ffffffmfffthfftfjf +1-4 h: hrxw +1-4 v: kvvv +6-12 r: crxrrzrnprrr +7-8 q: qqqfqqwqqqqq +3-4 l: lljllll +1-3 h: hhshh +2-3 q: qvqb +13-20 p: plpqtpppsgpppppppppz +9-15 w: wwwwwnwbbfwwwwwsw +11-12 k: kkkxqkksdlkg +8-14 k: kkkgkkkkgdjkxnktxd +17-18 s: sbsmssnssssstnsssq +4-10 s: sssbhfcssssxx +3-4 l: drbl +8-13 j: tjjtjjhljjjnjd +11-12 q: nrsqrqcmzqql +7-11 x: wxxlxxgwvxx +13-16 n: nnnnnnnnnknnjnnn +15-16 l: dwvlwglrhvqllllvvl +3-7 b: bbbbbbm +11-12 v: vvqlvvvvbvvktvvw +1-8 n: nwnnmpvx +7-8 f: zskgxljq +7-14 b: qxbpwbgvbgqdlbtfjdbq +3-9 v: vbxvrvhqvq +2-3 c: czfc +7-10 t: mtttnzvcttttjtt +6-14 l: lllllklllhlglll +3-4 b: wgzbpwpbj +1-6 z: mzzzbrzz +5-10 t: tttjtftttdttttttlt +9-10 z: hzzzvzzzmzz +14-19 n: lppspwbnhtzxcnrkgpn +5-7 n: bnnnnnt +11-12 v: hkkhvgvtvvvvqvjxv +2-11 w: wwjpfvqwnhwcmg +9-15 b: zbqndbbbbbbbbsk +11-13 d: dddddddddblddmddk +1-11 n: ngnnfnvnbkjpn +1-5 l: llllkllvl +17-19 g: gtggggcggfggzvgqgzn +9-10 g: ggggsslgxg +7-12 r: qrdrnrgdrrrrrrlr +1-3 h: hmkgg +4-9 t: jngjtmkms +2-5 p: qqfrpmnnppgpvpmwdfpp +10-11 m: mmmlsmmmmbqm +2-7 c: cpbdvfccxdzczsptncnn +6-7 d: mtdqrdd +10-12 v: vvvvvvvvvsvvvvvvv +13-14 q: gqqqqqqqqqqqqz +1-4 m: fmmmmm +4-10 b: bklbbzmdsnq +3-5 w: tjwwhkbbpwtt +4-5 l: llldv +3-4 t: ttttt +8-16 t: xlqhtttlhssjhxtt +12-14 m: mmmmmmtmmmmmmzm +1-2 c: cccc +1-4 x: mxkxcndbsfvfnxjwxh +9-13 n: nglxnhnnrktnnfznn diff --git a/2020/02/solution1.py b/2020/02/solution1.py new file mode 100644 index 0000000..c8e35ff --- /dev/null +++ b/2020/02/solution1.py @@ -0,0 +1,19 @@ +""" +Solution to 2020/01 +""" + +COUNT = 0 +with open('input', 'r') as file: + for line in file.readlines(): + rule, char, password = line.strip().split() + char = char[0] + min_occurence, max_occurence = rule.split('-') + min_occurence = int(min_occurence) + max_occurence = int(max_occurence) + + is_valid = min_occurence <= password.count(char) <= max_occurence + + if is_valid: + COUNT += 1 + +print(COUNT) diff --git a/2020/02/solution2.py b/2020/02/solution2.py new file mode 100644 index 0000000..27a4f90 --- /dev/null +++ b/2020/02/solution2.py @@ -0,0 +1,19 @@ +""" +Solution to 2020/01 +""" + +COUNT = 0 +with open('input', 'r') as file: + for line in file.readlines(): + rule, char, password = line.strip().split() + char = char[0] + pos_1, pos_2 = rule.split('-') + pos_1 = int(pos_1) - 1 + pos_2 = int(pos_2) - 1 + + is_valid = (password[pos_1] == char) ^ (password[pos_2] == char) + + if is_valid: + COUNT += 1 + +print(COUNT)