~necaris/advent-of-code

24b61418796e3172abf929179a86763b7f9ce13a — Rami Chowdhury 1 year, 8 months ago 4487221 master
Add Day 2
3 files changed, 1094 insertions(+), 0 deletions(-)

A 2020/02/input.txt
A 2020/02/main.rs
A 2020/02/sample.txt
A 2020/02/input.txt => 2020/02/input.txt +1000 -0
@@ 0,0 1,1000 @@
4-8 n: dnjjrtclnzdnghnbnn
5-6 r: rrrrcqr
2-4 p: pqhpppwpfmr
1-13 p: spppppppppppvp
5-6 x: xfwxxxxx
19-20 n: nnnnsnnnnnnnnnnnnnnn
1-4 z: zvzhbp
5-6 d: ddddhd
13-17 j: jjjjjjjjjjjtdrjjgj
1-16 p: tppqpppppppppcpspppp
15-16 r: rrzrsrrrprqrrrmdrrr
1-5 z: lqzdzqfz
1-18 s: nssssssslsssslshssx
1-12 p: gppppppppppppp
3-9 j: wfjtzbzzjtjwm
13-14 c: pjwhnjmgkgtpmcprbrch
5-10 l: glltvgdngllzlllplrlh
3-14 j: fdqhrzgcqvhvjjtvcx
11-14 g: ggggggggggzggb
1-5 w: wwwswwwvw
14-18 f: ffffffffmffffzfffwf
8-14 g: fgggzggmggggzmg
3-4 k: kbkkwthmc
6-11 k: kkkkkkkkkkkk
3-4 x: kxxx
6-8 r: rrrrrcrwkr
7-10 g: gxgqggkfgggfg
4-5 x: xxgxx
1-7 d: ddzczddd
6-12 f: fflffffffvrffflwfv
9-11 m: mrmvtmmmvqsmmxjmf
6-9 m: fnmjmmmmhmjtm
14-16 n: nnnxnnnnnnnnnnnh
1-16 h: xhhhhhlhhhhhhhhjhhh
2-5 g: hhgvpg
5-13 j: gtjbzlbjjjzhk
8-10 k: khkkkknkkknkk
6-7 h: hhhlhhhcnhghc
11-14 s: sssssssssvjssvssxss
6-7 z: zzzzzzz
9-11 j: jfjqjjjjjjjjs
5-12 m: vdmxclfpmmhmmgdffd
1-2 w: wzww
11-15 k: wbkkrmjkkzrxdkt
10-13 m: nmmmmtmsdmmmm
8-12 v: hwrfvlvvnmgv
9-10 q: qqqqqqqmqqlq
4-5 g: ggggggg
8-9 b: bnvfbbbpbbbsnwrbb
2-8 l: hjllblkl
4-14 z: hktzkqsjzzhlfmqghmt
11-13 j: jmjjjjjfjjjjjj
1-6 z: zvhhhzzxqzgzjqz
4-7 z: zqqzflzdckzztf
15-18 d: ddddddnqddvdddwddd
9-13 n: nhnnnnnnnnnnnnn
5-6 b: bbbbbb
6-8 t: ttqtrltb
2-3 x: qxkf
11-16 c: cmcpnzgckzczwvjfpj
5-10 s: pjlsksssdssss
1-3 w: vwdww
1-2 d: wndd
2-4 r: rfrsrrrr
1-3 z: npmh
12-17 h: hhhhchhkhhxcrbdhmhf
12-14 f: fffffzfmffffctf
5-17 b: bbbbbbmbkbbbbbbbbbb
2-4 n: ljnrn
6-8 r: rrkcrrrjb
1-8 l: vllllllllll
7-13 p: pppqxpppppppppp
3-8 s: gsssbsssgsfj
3-10 q: bvljgzpjhkhz
1-9 r: rdrpprgrjrr
10-16 n: sbnnhbrpnnmlnntn
8-10 g: gvggggvgwgg
7-9 m: mmmmmmmvrm
12-17 s: scssssscbssssssss
17-19 b: bbbbbbbbbbbbbbbbmbl
8-12 h: hhhhwhhhhhhhh
2-11 r: rrrrrrrrrrf
3-6 j: jkskqjw
2-7 f: fffftffff
4-6 s: fnssksssw
4-5 b: bbbbv
1-2 q: vgwmtzlmqqtgdgftjl
1-5 s: sfsdsss
3-9 p: qtfkfkzjl
5-10 j: zhsjsjnjjt
2-8 p: pppbppjpt
4-11 d: ddmddfdphdl
2-5 j: jjrsj
3-7 g: gggkgsjpg
3-4 j: jjkvjxjjj
2-3 v: hvvvv
7-13 d: ddddbddddddddddddd
6-8 d: dddddfmd
17-20 c: cccccccccgccccjcxcpk
2-3 g: cggdzjctdxgrl
13-15 r: dqrrrrrrrrrrrgrrprr
2-4 q: zqqq
1-6 l: llljll
3-7 v: vjbkvvzvv
14-18 h: hhhhhhhhshhhhkhhhj
6-10 z: zzzzzzzzzzz
4-5 w: tqwww
8-12 j: jjjjjjjjnjjj
5-15 t: bttjhtwttttpdzcwj
6-7 g: gnbrfdgrtdkgnxg
5-9 d: dvgpdxxddztkfqmtdp
15-17 v: zvfzplvvjsvvwjhvv
9-13 k: wkkkkkkmkkkkkk
1-7 h: nhhkhhhhhp
4-5 t: fktttptt
5-7 z: gzwztznzh
1-12 w: zwwzwwwswwwwwwwwww
1-4 f: wfhkbvpr
2-3 w: fwwwcbw
5-6 r: rrrrrr
3-4 t: ntsst
10-13 z: zzzzzzzzzzzgz
5-18 c: ccccccccgccccccccf
5-6 z: zzzxzrz
15-20 p: ppppppppppppppgppppp
1-2 t: kjpfpbkbtsg
4-6 p: ppjppkp
6-7 d: gvddtdd
6-12 w: pwwwftwwwwwlhwwrwwvb
8-11 j: wjjjjvjjjjj
6-8 w: wwwswxww
6-11 x: xxhqrxwxxbcxxzrxxc
2-3 f: fqbvzfghff
12-14 v: vcmvvvvfvzvcvvlvvvv
8-10 j: jjjjjjjtjcj
14-15 x: xxxwxpmxxxkxmrw
2-6 c: wccctcc
4-12 l: cllrllllllllll
16-19 q: qqqqqqqqfqqfqqqzqqcq
10-13 d: ddzdtdddgddmdd
11-12 n: qnnnnnnnnzndnn
2-5 c: gcdhctsqgpcbfxl
8-11 s: sssxssdckssfss
3-6 g: gbgghg
4-5 c: cvcxsdcrc
2-4 d: dtdcsdw
1-3 k: kwkk
3-5 z: lzzzzq
4-16 k: kkkbkkzkkkkxkkkgzxkk
2-5 l: nfpbbll
11-17 k: vzfjktqpfhkvlfkskwkn
2-3 v: vvmb
16-18 d: rddfdddddddcdddtddd
8-9 s: sssssssmq
3-4 n: nnnnqz
2-3 b: bbbccbdk
3-8 s: ssvssssd
4-6 s: sssjss
11-14 k: kkkkgkkkktkpkckkk
2-10 g: gngggggggwg
10-16 c: cccccccccccccccccwc
8-9 s: sckslspss
7-11 m: mmnsqxbpmmzmmmmmnp
4-5 f: ffffff
5-13 v: vvvvvvvvkvkvvvvv
1-15 p: ppdpppppspppppp
8-9 g: gggggggvz
5-7 f: fhtcrffftg
9-10 l: llllllllll
6-7 c: cjndcjb
9-14 b: bbbqdbbbxbbbbcbj
2-4 p: ppqppp
13-15 g: gggggggggggggrb
2-4 r: rffc
1-7 d: xzndhjdwnsm
1-4 b: rbbfbbbbbbbbbb
12-13 z: zzzzzzzzzzzzzz
6-12 f: nfldffdffctf
3-6 c: ccbcchm
6-7 t: rjptqtwtttx
11-12 h: hhhhhhhhhhhh
6-13 l: xpfwjllgqzcdl
3-4 d: dddd
11-15 b: frtbbbnkjbbbbbb
1-12 z: pfghwzrzzzffzkzsmxz
1-13 p: qppppppppppprppppp
18-20 v: vvvvvvvvvvvsvvvvvmbw
8-10 m: mmmmmmrtmx
2-4 j: jdsj
10-16 q: qqqqqqqqqqqqqqqq
11-12 c: ccccccccccph
7-8 x: xxxxxxxs
5-8 m: mmpmmmdmm
4-14 w: hlqwhwzmwzxwmwwq
4-5 c: xvrmccwbjccdpxc
6-7 g: gggtgskbppjg
1-8 v: pvvvkvvzbqvwvvvvhs
4-7 x: xxxxxxx
3-9 p: lpspmpjpkpppppppppp
4-7 z: hwckbdbdqqmzmkgtkn
5-7 r: ztptrrrhjcrkrgr
7-10 h: hhhhhhrhhw
10-12 w: wbwzwwwxwnwgwwcg
5-8 s: ssssrsswsssss
3-5 g: ggggmhf
2-3 h: shch
8-10 g: ggmgggnkggzgg
11-12 n: rsnnbnnrnnmlmnnzn
2-6 d: dddddndddd
3-4 t: mptdcrtt
2-8 c: scncnbhfdzvjjclgpkc
15-16 s: ssssssqsssssssvz
19-20 m: mmmmmmmmmmmmmmmmmmmm
1-6 r: grrrrb
13-14 f: fffffffffffvlffb
4-8 v: mkkvwjtvxcv
11-12 t: ttttnttttthprttk
9-14 j: jjsjjnjjjnxcjmjjh
1-4 s: pmmtfs
2-12 x: xxxxbxxrxpxxbxxxkxxg
1-2 f: kvbfg
15-16 l: llllllhlllllllll
16-18 n: dnhnnnnnnnnnnnnxnpn
9-11 f: fffxffnflfqffrdrb
16-20 d: ddtdddddddddhjddddnf
2-5 v: hnvvlv
6-13 s: ckrjsqsqszsmstsgq
7-8 w: zwwwwwfcw
2-3 h: hwjh
10-11 x: xxxxpxxxxpgxxx
9-10 q: qsqqqjqqqqq
3-4 v: vvwnvf
2-3 v: zvvxcnvvr
8-9 d: qdddddddd
1-15 g: ggggggggfgggggggggg
3-5 c: ccvwc
8-15 f: zfffffkffxfvpqfrtfff
2-11 q: vkngzshvnqqb
5-7 c: vcvcccn
12-14 f: fjbtfffvsffqfn
3-5 l: llllll
2-4 h: hhhh
10-11 x: gxxxxxxxxxxp
5-10 q: gjwclkqdqw
3-7 j: rbjrrjjljwkxgjmlhcxs
6-8 j: jjjvjjjj
12-13 p: znpppqppppbpspfpp
16-18 z: zdzwzzzzzzzzzzzzzzz
7-11 b: bbrpbsbvbqbblbbhbb
3-6 k: skxkrr
5-11 b: bbbbdbgbbbqbbbbbbb
8-9 q: qrqqqqqqq
17-18 p: ppppppjpppppppppmr
15-18 k: kkkkkkkkkkdlkkfkkn
6-8 g: ggfgggggg
3-4 x: xxwl
6-14 c: kvcdcccdlsswlcrcggzq
7-8 l: lllmxsllllb
14-16 q: qqqqqqqqqqqhqqqq
3-10 m: wgxshpmtvmhfjhkqqsr
3-10 s: ssssssszgssvsfsqq
7-10 t: tttttttttt
13-16 r: rcfrsfjbfcrgtwfx
10-12 p: vthpppxpptvdpkppppp
4-5 x: zzgxxxkxhxxnkbkmx
3-4 k: hkkdgbkwp
8-12 h: hhhsfhvhhxqjhhhhfh
11-16 k: kfkkkktkkxkkfkkkk
3-5 m: mhjmmmmmmmv
4-6 z: zzzgzqz
6-7 p: ppppppppppp
7-17 m: mmmmmmnmmmmmfmmmdm
2-10 w: rrwlwwrwwhfckflmzrwv
3-4 l: llll
3-12 d: mrddbzddpkddnbddddcd
3-5 j: vtjfbgjrqjgbqjffzvpg
9-19 c: cccclcrcccccccxlcccc
11-20 t: ttttsttttttgwxthtttt
1-5 k: klxknk
18-19 p: ppppppppppbppppppppp
1-2 v: vvvzw
12-15 z: zzzznlzbpzfnzzs
11-13 h: bhhhghhhhhjhhhh
8-9 p: ppppbphmpppzr
6-8 c: qcccdcldwqzjchckkcqc
12-14 t: tgttttpttttttmttntt
12-15 b: wbbbbjbbbsbgbbq
8-15 w: wwhwwjkcwhwncwmwwtwl
8-10 g: ggggggggggg
14-19 g: gggrdgkggggggggggggg
7-8 s: jsssssjts
3-4 z: pzzztrzjztjzb
3-4 v: mvzv
1-5 z: zzlzzzz
3-4 p: pptp
10-11 j: jjjjjjjjjjjjjj
2-14 s: ssrsssssszssss
2-3 g: qknb
1-2 m: mmbm
3-7 b: dbpblbc
1-4 f: fffff
15-16 z: plbzzzmzjvzvdxrvzv
3-8 d: ddzggxgdcjxd
6-10 t: xtlnktsfwt
4-6 n: nnkzcnpnwn
11-18 m: msgjhfcmzghgmjssmmmc
6-15 l: wphlcftpqnjlklbwljns
2-10 j: kjkxmrrjgjczjhwbzd
12-14 h: whhhhgbhzhhzhpthh
7-10 j: jjzjxjpjngjjjjjjjjj
2-10 s: gsvszqrkkm
9-11 v: vnvvhvvvrvb
2-3 v: vvzh
2-4 v: vpfvrng
6-7 z: dsrjhzzgrr
15-16 r: rrrrrrrrrrrrrrrprrr
17-18 d: dddddwddddddddddqq
4-6 z: zjznnmzfmk
8-9 m: mmmmmmmmmm
1-16 h: fhhhhhhhhhhhhhhch
7-15 k: kskkkkkckkhkkkkkkkc
11-15 n: qnnnnnnnnncnnnsn
4-6 p: psgcpbtpp
4-5 w: wbwzt
8-10 p: pppkpgpppp
7-8 d: dddnddgzd
8-14 v: bsvvgvvvxvvrvvv
2-4 k: krzb
14-16 b: bbbbbbbbbbbbcjbc
10-11 p: pppdgppplpcpwppn
1-3 t: ttttb
1-5 f: fffftf
14-17 z: zzzzztzzzzzzzdxzms
5-8 x: mfxxxltxx
2-3 q: qzqwc
2-4 s: sqsg
2-6 p: prjphpt
11-14 r: rqrrrrrrrrrrrz
6-7 f: fffffxgf
5-7 p: gspppqpprjpp
3-4 j: qhvjr
5-6 v: vvvvgfvv
12-16 k: kkkkkkvktkfdkkkk
2-4 m: swmc
7-11 p: nsnppppkpxppppp
1-6 h: ghkthggpldk
2-4 l: xllwl
2-5 h: qhmht
5-6 b: lrbbbj
10-11 c: tccccccccdccc
10-15 p: fpgppppppnkpppmhpg
16-18 j: jljmjjjjjjjjjjjnjjj
17-18 s: scssssssssssssssvz
2-10 j: xjjjjxmjjj
5-8 c: ccccckcccc
6-13 f: fpfffmfvrhrbsfft
3-7 l: kkzbswgcbsvglk
9-11 f: fdfffffffffvf
2-3 h: zhqhjhqtzw
16-17 n: nnnnnpnnnnnnnnnnn
8-10 j: jhjjjjjjjjjj
2-3 c: ccrscn
4-5 n: nnnnn
5-6 q: zzbrqq
6-17 j: glwjjmjjjjvjjjjjrj
9-15 c: zbrzccxntzbhccq
13-18 q: qqqqqqqfqrqqdqqmqq
7-9 s: sssssssss
1-4 x: xxfx
4-11 k: tvtkbklzkkk
12-14 r: rrrrrrrwrrrjrnrrr
4-6 r: jmrvrhtrrbrm
2-4 z: ztzf
3-4 q: qqbqq
1-10 m: kmmmmmmmmmmm
1-4 m: rmnd
5-6 b: bbbbbb
6-8 g: bxrmggqggjg
13-15 b: bqwvbsbpbbxvbbb
10-11 j: jjjjjcjjjjjr
4-10 x: jxxwxlxxlxxrxx
13-15 r: rrrrrrrrrrrrgrfr
8-17 n: qcnnnnnsjnnnnrnnwnn
15-16 k: kkpdvkqqskftsdkk
11-13 r: wddrrkrrrtqrp
1-3 f: mhst
11-13 z: zzzzzxzkqzzzjzzzzz
11-14 v: vvvgvvvvvfvlvmv
5-8 r: rrcbsrrb
1-5 x: xxwgxksmlxcqvfdrn
13-14 n: nnnnnxnnnnnnnnxn
2-3 c: cgscccc
1-4 h: vxkf
3-5 w: fwwgw
10-15 d: ddddfdddltddwtdddq
11-13 v: vvvvvvvvvvvvvvvv
10-13 v: cvwhdvpgvfvmtvvvvvv
10-11 r: rrxrrrrtwrrrsxrr
8-9 r: prkjsrhrrr
5-19 v: bvjvwgvgdvvpsvrvvvvp
2-10 q: wqqqqqbkqq
10-11 f: ffffffffkgw
9-11 p: ppppppppjbc
2-8 b: bbhbbdbbbb
8-9 h: hwzshwmhhfhh
3-10 r: gwnhftrjrfrbrczrj
1-5 f: ffftf
1-7 g: lcggrjg
3-14 j: jjvjjjjjjjjjjjjj
5-18 q: hqqjqlddxqqsdpqhgwqm
5-8 m: jjnfzrzprhpgdfd
2-4 x: dxxxnxx
7-19 q: qkqqqqmbqkhqnqfptgq
5-7 q: fqjqwqqxpdmqh
1-2 x: xxtx
5-15 v: vvgvfvlvvvvvvvsvvv
1-9 q: rqqqqqqqqqqqqqqq
4-5 k: kzkkk
13-14 c: cccccccccccccc
5-8 w: wwwwwwww
1-5 z: zxzdzzzzzmzm
10-15 r: rrrrrrbrrrrrhrrrrr
9-10 f: ffxfffgffff
3-12 p: ppppbspqtfplpp
1-4 z: mzzn
1-14 w: vkwdwwsnpwxwwrvwwr
2-3 h: qlchhm
10-12 b: pbbbbbbbbjbq
4-5 h: vfhnwhxhhtg
16-18 z: zzzzvzzzzzzzzzzztpz
7-10 j: jsjjjjjdjbmjrdbn
1-2 x: qnxxxjxx
4-5 k: kkkkkk
4-5 h: hhhtg
1-3 x: xsgbd
10-11 f: ffwsfmhxcfdfffffsff
11-12 h: hhhnhhhhhhhfhhgh
1-4 b: fbbg
2-11 f: cfhtkftnrbhlvqsl
8-13 j: sddtjjjjlzqjtnjjj
2-4 l: wmxltll
1-9 k: gdjhphrfxsdpjqqkx
15-17 n: pptwgnwfmmnxswjzn
17-18 k: kkkkskkkkkknskkkkkkk
12-17 c: ccccccccccsccccccc
8-17 b: btxbbbbmbbbbbbbbcb
17-20 s: tshrnrqlssdtsnsdsgcw
2-4 w: wwww
1-5 s: lhspxs
9-13 g: cggggchgggfzgggg
1-2 v: vvvfm
1-11 v: vfvvmfvtnvvkvc
18-19 b: bbbbbbbbbtbbbbbbbbbb
8-10 p: ppfpppjzpvr
6-12 r: rrrggrcrmrlr
5-6 d: dpddls
1-3 r: rrrt
1-3 j: jjkghtlh
3-9 q: hcqqhgrjqqvtqqjvjxvl
7-9 n: nnnnnnnnn
11-12 v: vvvvvvvgvvvv
4-13 d: djddddmdgddddddx
1-2 b: sbbq
9-14 b: dbdgpsfzbjpkbbkbzs
7-13 p: pppftpxlrbhrkpppp
1-6 p: ppppppp
2-4 w: wwnw
8-15 l: klllllllllllllkll
4-8 z: zvzzzzgzzz
15-16 n: nnknnnnnwnnnnnsnnn
1-8 c: chczcdcccpccc
2-13 f: gfblfggbfzhff
2-6 g: njglpsbmxrl
16-18 q: hhvfzzqqqnqhpwxqvq
4-11 f: ffsffnffffsfs
14-16 m: mmmmmmmmmmmmdqmmmjmm
3-11 l: llglllllllvl
5-10 l: tngnngcrjnhfpklt
12-14 n: nnnnnnnnsnntnx
4-16 b: hdbbjbhzcbvrfbhbntb
14-15 r: kxrrrrrrrrrrrrrrr
9-11 d: dhdtjdddsdzqddzdxxd
5-11 n: ndxnnsnnnndn
5-6 n: xnnnnnn
3-7 s: ssssgvscxldkdlspct
13-17 f: fffffffffffffkffff
8-13 v: vwwvvvvzvmvkq
2-6 t: tstplhxt
2-11 c: zfcgscfpgcbbqc
4-5 z: zszqqxcbjnrwkwzgnjzt
12-13 g: ggggjgggggggggjgg
4-5 j: wjmwcrsjjbpt
1-4 n: nnnqn
2-5 g: zggggtgx
3-8 h: zhphrhbhkhbxwh
4-5 c: cccbhc
10-13 d: wgdddddzdlndnkddqdwg
18-19 g: gggbgggbhgpggggggdz
10-14 x: xxxxxxxxxqzxxgq
7-19 t: dtsmsstnttxttrttttt
3-4 s: stsd
1-4 d: dddn
4-14 b: frgbbqbbqbgqjgln
6-7 h: hhhhhgs
11-13 w: xwqwwwwwgzwwwklwtsw
4-5 s: ssskz
1-14 s: shsfrdqnssswss
2-3 n: nhknnnnnnnpnnnnnn
5-13 q: qqqqzqqqqqqqqq
3-10 b: rfbksnzmsbkpdbrfpfks
1-2 v: vvdqwbknv
9-10 r: rrrrrrrrmr
1-2 b: sqbbbc
10-11 n: nnnnnnnnnznn
1-8 t: thtjttctdmgvnwfr
14-16 j: jjjdjkjjjjjjjjjjjvj
7-8 v: tvvnlvvvhvvv
7-13 s: fshsssssssfsslpjsr
6-10 s: ssssssssssss
3-7 m: mqmzmsm
2-13 z: cnlbjnngdzsqtnbk
5-6 j: jjrdnt
14-15 h: hhhghhhhhhhhhpm
2-6 l: lnkllpfdsd
8-9 p: pptpppbvzp
13-15 x: xxxxxlxxxxxxbxh
2-9 k: xrglrkvkkrkkxkk
4-5 r: rlffgcqjbrvtdscr
2-8 n: nnnnnjnn
7-9 b: vdspbxxbg
9-10 b: bbbbbbbcrvbbbbbbbbb
5-10 l: lhllvpvxcbfclllvll
2-5 n: mkjnz
10-18 b: bhthcpbwbbpdjspbsb
8-10 r: rrprrrqsrrrgzrlcf
12-13 w: wwwwwwpwwwwdb
4-16 z: zzvnzzzzzzzqwzzlzz
12-17 t: tttttttbtwttdttttttt
2-3 b: bbbc
2-9 b: phbmnbbdgbxbr
6-8 r: rprrrrrr
14-16 x: xxxxxxxxxxxxxxxx
10-11 d: dvdrdkdfhdtdddddd
6-7 v: vgvvvvvvjw
3-4 h: hhhh
7-10 m: hmmqdssxmnmm
5-6 d: dddddn
13-19 x: xxxxxxxxxtxxgxxxxxc
5-12 g: ggxmgzlggbggggltkggx
1-15 f: nznmdrdfbrcnnslh
7-8 g: jxjgqmggggtdgsdgggm
1-3 p: kpjxqpkpp
3-4 s: fbxl
1-4 j: jfhjdlxbwrdjxzktz
11-12 m: mmmmmmmmmmmm
16-17 v: vvvvvvvvvvvvvvvnz
8-15 z: bzzdzzqztznfgzzvz
2-4 c: fglsc
1-8 q: qbqgqgtq
11-13 c: ccrjctrpfcxccqv
8-11 l: llllllnlllgfc
4-6 l: glqltllxllhb
7-10 c: fclctdcgcqjlctc
5-12 t: dtttttmttvbt
3-5 d: vddtdzdddvgd
8-18 z: zzzzzzzzzzzzzzzzzz
1-8 s: qtspsssw
4-6 g: rsggjm
1-12 r: drrrrrrrrrrsr
3-15 q: fqtsbqtcjqqzqqwq
2-8 v: qvsvcdvvvvv
4-6 p: pkctjwgjpm
3-5 s: ssgwns
11-17 v: vvvvkvvvvvvvvvvvrvp
5-10 f: ffffhxffxgfffx
1-2 h: dnhhhhhhh
5-11 r: jzltrrrvtjrs
3-6 c: hcccpqrcd
4-18 p: nrpppbkvwrlzjvpwcpt
6-7 q: qqqqqkh
6-8 v: vvvvvvvv
4-5 b: bjpnk
7-12 r: rvrrnrrdrlrr
2-17 j: zjjjcjtjjjjfjspjj
1-4 g: gggg
4-9 f: lfffwffffzwffn
1-7 z: nzzxzwpzpfzzzz
5-7 z: zzcjbztlc
2-3 s: sjsqzfhs
7-11 n: nvnsnjvnhtsnphkzs
11-12 n: nnnnnnnnnnjc
1-4 d: vddg
3-4 q: qqzw
8-10 t: thzttttsptt
3-9 w: lwpgwrwmgc
9-13 d: bdfmkdlbdgtdd
2-3 l: jlll
4-6 v: mscgmnvvtvtzvklqhzvv
2-10 c: ccnzfcmzccpqnc
6-9 w: wwwwwwwwsj
9-15 l: llllnlllmlllxll
8-9 q: lqqbffqqqqnlqzwqqlrg
7-9 p: pppppzptbp
9-13 b: bbbbbbbbhbbbv
13-20 p: zhpppppppppppppppqpp
7-8 d: dddddddd
10-11 v: vvhvvvvzvvvgvzv
5-7 x: xxxxvxt
7-14 d: ddddddcdlddddpvjdd
4-5 x: xxxnx
4-11 m: mdrjmkbhmmgmmmm
11-17 v: vvvvvvvvvvvvvvvvkn
10-17 l: ltddhlllllljlllllll
6-10 j: fbjnvgtwdm
9-12 c: lcccccgcfccccc
7-12 z: zlqzzhbmzzqszzg
4-5 s: ssssslh
10-19 x: wjzfxrcdpxzxxxxgkmx
11-14 l: klllvpklrlpllvllll
5-7 h: hhhldtrhhzg
7-8 p: dbkpqpnv
1-15 b: bbbpbbnbnbbbjkb
2-3 v: vrkvv
9-18 b: bbhbbbgbbfbbbbbbbcqb
3-10 f: fdlvdffffhfffff
7-8 s: xsgssfstsssnlrzqs
6-8 p: vprjjprzb
7-8 q: htstsgqkqn
9-14 f: fkffffqfjfffzffnf
16-17 x: xxxxxxxxxxxxxxxnr
1-14 m: mmmmmmmmmmmmmmmmm
14-16 d: kwtvhfwddvcxdddd
3-15 k: kknkkkkkkkskkgkkkdkk
3-6 d: dsdmndpdmvcllq
4-5 d: gdvqqqtqw
13-14 l: llllllllllllwb
8-14 h: chlhflhxhchnwl
12-15 j: jjsljjjjjjjhjjwjj
3-14 c: pxxlstbvfmmzhcjcv
4-14 p: fhpxvfxblfphhjppdddp
2-3 j: jjjj
16-18 r: rrrrrrrrrrrrrrrrrp
8-13 p: vlppwpphhjppk
8-11 w: wwwzwwmlwwwwwww
14-16 k: qqvtnmpkkrpfzsnftwtk
15-17 b: bbbhbbbbbbbbbbbbbb
7-8 m: mmmmmmsj
11-12 v: vzvvvvvvvvvvv
5-8 p: jpppphpp
3-4 n: ndjntnl
10-11 v: jmcvpvvfxhjw
1-4 p: pndptkg
1-2 z: gmzzpgzrzzzr
4-6 b: rrbnbbblb
7-8 r: rtrrrrrr
5-6 z: zznzzk
12-13 j: jzjdvqjsjpljjnzjsvst
3-4 k: gkkkrk
8-10 g: ggggxgglghw
5-8 w: wwkwwwww
1-2 x: xjrgjxxns
3-5 s: mlszs
2-5 r: trrglpk
14-15 d: drdjwgvdxcrgdvpxd
4-12 h: wpklmfhrkcqdd
6-8 v: vpvxjlvl
16-19 m: mmmmmmwmmmmmmgmbmmhm
11-12 n: nnxnhqrnknlp
1-3 h: hknfhwwz
3-4 r: zrrlrqbp
16-17 h: hhhhhhhhhhhhhhhwh
4-7 b: xbqxbkjbbbb
7-9 g: ggggggggg
8-9 t: tttttttkt
2-5 j: fkjhxjjftwjpgjxq
5-8 c: ccvcccvcc
14-17 g: gggggggggggggnggpg
8-12 x: xxxfxxxxlxtpxvx
7-12 l: lllllllllllllllll
6-8 v: vzvvvvvvvh
7-9 w: wwwwwwswj
2-3 j: lvvrj
3-4 r: rnrrsr
1-8 c: kqvcsngc
4-8 r: rrrrrrrr
4-6 z: cczzzgz
2-4 v: vvhvkm
10-14 h: ccnhhbhhhhhmhhh
3-4 v: cvvvvfcwmg
8-15 g: ggghgckggbkggmgggkkg
10-13 v: vvvvvvvvvqvvm
1-3 h: hhkhh
4-6 l: llldlg
8-19 c: czcsjccrqcvjcclcccc
13-20 s: ssssssjsssssssssssss
5-6 s: tsssvjqlls
4-9 s: sntvsssszsm
9-10 j: jjjjjjjjsdjj
9-10 z: wpzmzkzzzzzvd
6-17 g: gglfgqkglgrgrggnzg
10-11 f: ffsbdjfhbdgfksffhn
9-10 n: nnggcfptnngnnszppgv
8-12 w: wwrwwwwwnwwwwwwww
7-17 r: wkrrfcrjrrdprpxrrcr
9-10 m: mmmmmmmnwxmm
1-8 x: lxbxxxxd
1-6 h: xhhhhhhhhh
8-12 b: bmbbbpbnkdbbbjblbb
7-9 m: dmmtwmcdgj
1-3 q: qcqvqlqggzrhm
10-15 v: vvvvvvvvvvvvvvvv
1-13 l: llglllwllllblllll
2-7 s: szsszstbsg
1-5 h: hhhwhhphzczth
7-18 f: xnzzkfqsfntwtfwflb
3-5 v: fzdvg
2-8 s: lsvsshsssss
10-11 z: zzzzzzzzxzzxzzzzz
1-4 r: prrrrrr
6-8 p: prlnkpppfpqvwkpkcpll
9-15 j: mjjjrjjcqjwjjjjj
7-10 k: kklkdkpknlkks
1-9 n: dnmbgnnnnbnw
3-6 l: blwlsx
2-7 m: mbmmlkrmj
12-13 k: kkkkkkkkkkkkk
7-9 t: trttcgtttttt
14-15 l: llllpllllllllll
3-18 j: jzjbmxfwggkvlbbbmjm
1-4 v: pvrrvv
13-14 j: jjjjjjjjjdjjgjj
3-5 x: xqxxxsx
2-3 z: zzsxz
3-7 n: nnnnrtjbnn
1-2 d: dddddddd
8-11 b: bbblfbjqbbkqkcbbbbm
4-5 w: swqrftwvwwq
3-4 c: bsnpvrccvthcwb
4-6 p: pplnxkpw
6-8 k: krkkkkkk
4-8 x: ggdsdrdncmkpvqrxckt
9-18 t: ttttttttttvtttxbht
13-14 w: wwwwwwwwwwwwww
3-4 g: pgggmgxdm
13-14 r: rrrrxrrrrrrrtp
5-8 h: qmhhhhht
3-4 b: zbbbzb
4-6 h: hlkhhr
4-5 g: hlghgklvpgg
12-13 q: qqqqqqqqqqqbx
5-10 g: ggggdggggm
7-12 r: rrrrzrrrbbbrk
8-9 h: hhxhhlhwhxhhhn
4-13 h: hhhhhhhhhhhhkhh
2-4 q: cqlqqwqpvwvqcx
3-4 n: wvcqnwkp
1-2 b: bbbb
4-14 d: wdcdqddgcvppdd
4-5 s: dsssv
3-8 t: cttttttvmtttszqttt
6-7 m: mgmmbmwtmm
3-4 h: hhhhh
10-11 q: qngqqqqqqqqq
4-9 x: xmxkbdxfc
1-2 q: gqtg
8-10 k: kkzkkkkkkkkkkkkkkx
4-8 f: ffkffvkfvfp
14-15 b: bbbbbbbbbbtbbbk
8-14 f: ffnfkpfkxvmvfjpffrr
9-13 r: rrlrrxkrzrrrkr
2-4 x: xxxlx
1-6 c: mcfccc
16-17 v: xvvvvvvvvvvvvvvvv
2-7 t: dvzktkt
9-18 z: ztqzzfzzzczjzczhzkzz
2-13 z: czkznmsgqmhfz
1-8 f: wkffffffffxfffffffff
6-9 b: bbbrrbxbrbxqb
6-9 x: xqxkxfwpsxxdxtnxd
1-13 j: jjjjjjjjjjjjjjj
2-4 h: thzhxhhk
4-14 t: ttfttttcttttttt
9-18 t: wbtbptjfnvtvcnttctm
1-2 p: tjcdfkt
5-9 z: wrzztzmkz
5-6 g: ggggqg
4-5 d: fdddd
1-10 n: bdnnncbsbjnccf
14-15 f: ffffzfffffffcpw
8-9 t: ttttttttt
11-16 p: rppppppppppsnjnppppp
9-12 r: llrclfnkcrrrrrrrrdt
2-8 r: rrrrrrrrr
7-8 f: lmdnndpwfbqfxrnqw
3-9 k: kkkkkkkkskkkkk
6-14 h: hhhhhhhhhphhhh
2-11 g: ggggggggggffl
2-10 z: zxzzzzzzxgmfzt
10-11 r: rrrrrrrrlrrdxrr
2-5 m: mvqmq
2-6 w: wwjlwwwqmsn
3-5 j: jzjjq
4-7 j: jjjnjjnj
3-4 v: vvvj
1-4 h: hhhh
10-11 w: wwgwwjlwwkccmfwwkq
13-15 k: kkrlkkkkkkkkkkk
4-5 q: qqqbr
2-4 h: hqhh
9-12 k: kkkfvpxkkkrkkkb
7-10 x: xxxxxxxxxx
5-9 n: nnznnnxmn
16-17 c: ccccccmcccccclczmc
1-3 x: xxxq
9-18 w: wvwxwwtwwvgwwwwnwwf
14-15 l: lcllllllllllllllll
15-18 f: fffffffffffffrdffnf
6-7 k: kkkxlkbkk
5-7 j: jjjjqjtjj
1-9 b: jbbbxgqqjdlb
1-3 r: wwrmvlqzhqsltznlhcd
9-11 d: dddddddddddd
4-9 l: llrmlvllrvl
2-7 f: tfgfvwjsnflh
2-3 v: cvvvv
3-6 z: nkzwnzkvzqlzkwszdz
3-9 v: vhqzcvvvfrvdm
12-13 n: nnnnnnnkfnnqjnnw
6-14 f: ffffffffffffff
6-9 x: mxxgrnxxqxcglx
4-7 w: whwwwwwnw
1-5 v: vvflv
3-6 h: hhhhhh
10-12 k: kkktrgncpkvkk
1-3 w: wfwqq
18-19 l: llllllqlllllllllllj
7-10 t: fttthttjqtj
7-9 b: bblbbbwbt
5-7 r: rrhrqrrr
1-7 w: kwwwwwsw
4-6 h: hpnmzhbhfhqntvr
5-8 x: mxmxpxxjvx
6-10 t: qgtmhfflnbvnttpngvvj
4-9 t: tvtfttttvtl
3-4 q: qhxv
3-8 x: fxcxlxjsxwgs
14-16 k: kkkkkxkkkkkkdrkv
2-4 x: qppr
9-13 b: bbbbbjzbsbgbzbbbbb
4-13 s: sssssssssssssss
3-10 d: dslldmdwdfwdwnmpjd
7-8 s: sssssssr
5-7 f: fffffffh
1-2 f: ffxf
2-3 c: cccc
10-12 c: cchccccccccc
12-14 q: hqmhqqrqvlgqgqlqtsqq
4-5 m: mmmms
2-12 j: bjfjdjxmjcjjhtzvs
4-13 p: bsprpkglzfscp
5-7 d: dddddbdddzt
2-8 q: vqcqcqrmqg
9-10 v: vvbvvvvvvv
9-10 c: cccccccbsc
10-14 n: nnnnnnnqnknnnznn
5-7 t: ttttttt
7-12 c: ccccckccckcccg
3-4 b: mgjbbsmbcbbp
4-8 t: swztttxttttpsvt
11-12 r: rrrrrlrrrrrc
3-5 t: tmppv
2-11 v: nspwbnmjcvszpvrhvjv
4-5 v: vvvvvtv
8-9 x: xnndxxxtrxqfxx
13-16 s: zdsqjvrhqxxswscszbl
7-15 s: sjsjssqsssssssss
2-16 j: nzxqwnjkjjqczhjkjdj
13-14 z: zzzzzzzzzzzzzz
2-4 j: jmjh
7-8 t: httftnsmtt
2-3 f: gpfc
12-13 x: pxxxxxxxxwxvqxx
1-5 h: hbqkhp
5-9 k: mmkkhkkknwqk
1-4 j: jjjxjtjjjjjdj
4-5 r: rfrrrr
1-7 d: fpbqxxddh
9-13 g: gggggvggggggggg
4-8 q: qqqkqqqqq
16-18 x: mpxdckjxbqhmxxlxxzxx
2-14 f: fffwffffffffmff
15-19 w: bzmkzxqthgswzlwnphww
4-7 j: jzjjzjjpzjlvjjjjljj
2-5 b: brbbwprbvb
5-7 x: cxrxwxw
2-4 n: nnhn
3-4 q: qqsqq
8-15 v: hnvzkvvrjnvvvvvj
3-4 j: jjcjjp
1-7 d: ddvddddbd
3-8 v: pgvfvrcv
5-8 p: bbppdttpkpfp
12-17 k: kkkfkkkkqkkqkkskdk
1-8 k: pcbkwswkmkkkbkrkk
16-17 f: fffffffzffffffffff
3-7 q: qqqqqqq
2-4 s: sssss
11-13 x: jxmczktzfrrrv
15-19 l: lllllclllllllllflll
8-14 m: mmmmmmmmdmmmmmmmmmmm
5-10 j: jjdxtcpwfxqqgpn
2-7 n: nnmnnnjnnntz
10-16 j: jjjjjjjwjpjjjjjnj
3-15 m: mvmttdmmsmmmkwmx
3-4 q: qqqql
5-6 b: bbbbjn
14-17 t: ttttttttptttttttxt
12-17 m: mqgpmmmmbmmmmmpmmg
19-20 n: njngnntvnnpndnsndnsg
1-7 j: gbxzpqwcsc
1-2 r: mxdvrbqr
5-10 z: fzxzpczfcbkzzzzzz
7-8 d: dddddddddd
9-10 d: ddddddddpz
3-16 b: bbjbbbbbbbbbbbbb
8-10 b: bbcbbdbvbk
12-16 x: xxxxxxxxxxxxxxxbx
1-3 l: nklsbwr
3-7 k: kkkfhkkzwkz
5-10 f: lqphfhztff
2-4 k: kqffwknfrg
5-9 w: wwwwqwwwpww
1-6 z: jdbrjvm
7-8 r: rrrrrwrrlmr
2-13 m: nszmspbmrrtpwppmq
14-15 z: zzzzzzzzzzzzzzz
4-9 x: dmklkllxx
3-4 m: mmqpfmgzgkhwz
1-6 q: fphqvm
9-12 p: pvprppdtpxsjbpmmppp
4-5 x: xxxqmx
1-9 d: ddpjdcmbdstn
1-3 g: gggg
2-4 w: wlclwzf
5-11 f: ffffbzfnwfh
2-4 v: vhvhj
1-4 h: hqskhghrznfkkg
2-6 b: bxbbtk
2-4 x: xxxx
7-8 w: wwwwwqnxwww
2-12 h: hshhnhhxlbfchhhdhhsh
16-17 q: qqqqfqqcqdqqtqqcf
9-12 t: ttttttttjttt
1-3 m: hdzdvv
5-14 r: rmrkrbrrlrrrhwrrpkr
4-6 g: gggggx
15-16 r: rrrtrrrrrrrrrrtp
5-13 q: mzqtnknqzqgqhqdkwmlf
13-14 d: ddddddddvdddddd
4-5 p: ppprzr
7-8 z: zzxzzzfjz
8-9 c: ccgzcccmhcc
4-5 x: hxxxxq
1-3 t: ttttttpttltt
11-14 h: hhchhbtvfvjhhr
7-8 r: brrrrrmrrr
8-12 v: vvvvvvvnvvvf
5-6 l: nddlllwlllll
13-14 k: kkkkkfvkkkklmwkk
8-10 t: tttttttttt
2-9 k: jbrxrwkhkh
4-5 p: hpppp
10-12 z: zzzzzzzzzzzfzz
2-8 c: cqxkjkdhkgsdddtvt
1-5 d: dddsdhd
4-13 v: vvxlvvvvvvvvgvv
1-4 q: pqqv
3-4 k: krrk
6-8 v: cdvvvxvhvvvvv
1-3 d: ddddtd
10-11 b: bbbbbbbbbpj
9-16 d: ddrddddgdcddddddd
9-10 k: llrctckdkkv
8-11 f: jnffzfrffgffsfwfvkkj
8-13 d: dbddnddnjdmjdddkdd
5-6 b: bbbbhzbz
2-11 h: hhvghhhhhhh
15-16 q: qqqqqnqtqqqbqxqlqqcq
4-5 k: kkkdw
10-16 j: jqvhdjgmkjckjlpg
6-11 q: vqdnfbqqgqmqqqqq
8-11 q: qqrqqqqqlkq
8-11 v: wvvvvvvvfvvvrvvj
8-13 s: ssssssssscsfsss
6-8 w: pwwtwwlwwhww
8-9 f: ffffjfflb
2-4 v: jvgxmphvr
2-6 r: rrzrcd
10-16 n: lvknnwnnvsmnnnnhn
12-13 r: rrrpjrrrrrrtfrkwmr

A 2020/02/main.rs => 2020/02/main.rs +91 -0
@@ 0,0 1,91 @@
use std::env;
use std::fs::File;
use std::io::prelude::*;
use std::io::BufReader;
use std::io::{Error, ErrorKind};

#[derive(Debug)]
struct PasswordEntry {
    min: usize,
    max: usize,
    character: char,
    value: String,
}

impl PasswordEntry {
    fn is_valid_1(&self) -> bool {
        let count = self.value.chars().filter(|&c| c == self.character).count();
        count >= self.min && count <= self.max
    }
    fn is_valid_2(&self) -> bool {
        let first = (self.value.chars().nth(self.min - 1).unwrap() == self.character);
        let second = (self.value.chars().nth(self.max - 1).unwrap() == self.character);
        if first && second {
            return false;
        }
        first || second
    }
}

fn main() -> Result<(), Error> {
    // read all the numbers in
    let args: Vec<String> = env::args().collect();
    let input_path = args
        .get(1)
        .ok_or_else(|| Error::new(ErrorKind::Other, "need an input path"))?;
    let input = File::open(input_path)?;
    let reader = BufReader::new(input);
    let mut passwords: Vec<PasswordEntry> = Vec::new();
    for l in reader.lines() {
        let line = l?;
        if line.len() < 1 {
            continue;
        }
        let spec_value = line.split(":").collect::<Vec<&str>>();
        let minmax_chr = spec_value
            .get(0)
            .ok_or_else(|| Error::new(ErrorKind::Other, "Unparseable line"))?
            .split(" ")
            .collect::<Vec<&str>>();
        let minmax = minmax_chr
            .get(0)
            .ok_or_else(|| Error::new(ErrorKind::Other, "Unparseable"))?
            .split("-")
            .collect::<Vec<&str>>();

        passwords.push(PasswordEntry {
            min: minmax
                .get(0)
                .ok_or_else(|| Error::new(ErrorKind::Other, "Unparseable"))?
                .parse()
                .map_err(|e| Error::new(ErrorKind::Other, format!("{:?}", e)))?,
            max: minmax
                .get(1)
                .ok_or_else(|| Error::new(ErrorKind::Other, "Unparseable"))?
                .parse()
                .map_err(|e| Error::new(ErrorKind::Other, format!("{:?}", e)))?,
            character: minmax_chr
                .get(1)
                .ok_or_else(|| Error::new(ErrorKind::Other, "Unparseable"))?
                .chars()
                .next()
                .ok_or_else(|| Error::new(ErrorKind::Other, "Unparseable"))?,
            value: spec_value
                .get(1)
                .ok_or_else(|| Error::new(ErrorKind::Other, "Unparseable"))?
                .trim()
                .to_string(),
        })
    }

    for p in &passwords {
        println!("parsed {:?}, is valid? {}, {}", p, p.is_valid_1(), p.is_valid_2());
    }

    println!(
        "Valid passwords: {}",
        passwords.iter().filter(|p| p.is_valid_2()).count()
    );

    Ok(())
}

A 2020/02/sample.txt => 2020/02/sample.txt +3 -0
@@ 0,0 1,3 @@
1-3 a: abcde
1-3 b: cdefg
2-9 c: ccccccccc