Ver código fonte

days up to 4

metya 2 anos atrás
pai
commit
30244f1d9d

+ 27 - 0
.gitignore

@@ -0,0 +1,27 @@
+
+# General
+.DS_Store
+.AppleDouble
+.LSOverride
+
+# Icon must end with two \r
+Icon

+
+# Thumbnails
+._*
+
+# Files that might appear in the root of a volume
+.DocumentRevisions-V100
+.fseventsd
+.Spotlight-V100
+.TemporaryItems
+.Trashes
+.VolumeIcon.icns
+.com.apple.timemachine.donotpresent
+
+# Directories potentially created on remote AFP share
+.AppleDB
+.AppleDesktop
+Network Trash Folder
+Temporary Items
+.apdisk

+ 51 - 0
aoc2022/.gitignore

@@ -0,0 +1,51 @@
+# Files generated by invoking Julia with --code-coverage
+*.jl.cov
+*.jl.*.cov
+
+# Files generated by invoking Julia with --track-allocation
+*.jl.mem
+
+# System-specific files and directories generated by the BinaryProvider and BinDeps packages
+# They contain absolute paths specific to the host computer, and so should not be committed
+deps/deps.jl
+deps/build.log
+deps/downloads/
+deps/usr/
+deps/src/
+
+# Build artifacts for creating documentation generated by the Documenter package
+docs/build/
+docs/site/
+
+# File generated by Pkg, the package manager, based on a corresponding Project.toml
+# It records a fixed state of all packages used by the project. As such, it should not be
+# committed for packages, but should be committed for applications that require a static
+# environment.
+Manifest.toml
+
+# General
+.DS_Store
+.AppleDouble
+.LSOverride
+
+# Icon must end with two \r
+Icon

+
+# Thumbnails
+._*
+
+# Files that might appear in the root of a volume
+.DocumentRevisions-V100
+.fseventsd
+.Spotlight-V100
+.TemporaryItems
+.Trashes
+.VolumeIcon.icns
+.com.apple.timemachine.donotpresent
+
+# Directories potentially created on remote AFP share
+.AppleDB
+.AppleDesktop
+Network Trash Folder
+Temporary Items
+.apdisk

+ 5 - 0
aoc2022/.vscode/settings.json

@@ -0,0 +1,5 @@
+{
+    "cSpell.words": [
+        "markdownify"
+    ]
+}

+ 1 - 1
aoc2022/aocutils.py

@@ -72,7 +72,7 @@ def get_input(task_dir: str, day: int) -> tuple[list[str], list[str]] | None:
 
 if __name__ == "__main__":
     
-    day = 6
+    day = 8
     generate_readme(f"day{day}", day)
     get_input(f"day{day}", day)
     create_jl(f"day{day}", day)

+ 220 - 0
aoc2022/day10/README.md

@@ -0,0 +1,220 @@
+--- Day 10: Cathode-Ray Tube ---
+--------------------------------
+
+You avoid the ropes, plunge into the river, and swim to shore.
+
+
+The Elves yell something about meeting back up with them upriver, but the river is too loud to tell exactly what they're saying. They finish crossing the bridge and disappear from view.
+
+
+Situations like this must be why the Elves prioritized getting the communication system on your handheld device working. You pull it out of your pack, but the amount of water slowly draining from a big crack in its screen tells you it probably won't be of much immediate use.
+
+
+*Unless*, that is, you can design a replacement for the device's video system! It seems to be some kind of [cathode-ray tube](https://en.wikipedia.org/wiki/Cathode-ray_tube) screen and simple CPU that are both driven by a precise *clock circuit*. The clock circuit ticks at a constant rate; each tick is called a *cycle*.
+
+
+Start by figuring out the signal being sent by the CPU. The CPU has a single register, `X`, which starts with the value `1`. It supports only two instructions:
+
+
+* `addx V` takes *two cycles* to complete. *After* two cycles, the `X` register is increased by the value `V`. (`V` can be negative.)
+* `noop` takes *one cycle* to complete. It has no other effect.
+
+
+The CPU uses these instructions in a program (your puzzle input) to, somehow, tell the screen what to draw.
+
+
+Consider the following small program:
+
+
+
+```
+noop
+addx 3
+addx -5
+
+```
+
+Execution of this program proceeds as follows:
+
+
+* At the start of the first cycle, the `noop` instruction begins execution. During the first cycle, `X` is `1`. After the first cycle, the `noop` instruction finishes execution, doing nothing.
+* At the start of the second cycle, the `addx 3` instruction begins execution. During the second cycle, `X` is still `1`.
+* During the third cycle, `X` is still `1`. After the third cycle, the `addx 3` instruction finishes execution, setting `X` to `4`.
+* At the start of the fourth cycle, the `addx -5` instruction begins execution. During the fourth cycle, `X` is still `4`.
+* During the fifth cycle, `X` is still `4`. After the fifth cycle, the `addx -5` instruction finishes execution, setting `X` to `-1`.
+
+
+Maybe you can learn something by looking at the value of the `X` register throughout execution. For now, consider the *signal strength* (the cycle number multiplied by the value of the `X` register) *during* the 20th cycle and every 40 cycles after that (that is, during the 20th, 60th, 100th, 140th, 180th, and 220th cycles).
+
+
+For example, consider this larger program:
+
+
+
+```
+addx 15
+addx -11
+addx 6
+addx -3
+addx 5
+addx -1
+addx -8
+addx 13
+addx 4
+noop
+addx -1
+addx 5
+addx -1
+addx 5
+addx -1
+addx 5
+addx -1
+addx 5
+addx -1
+addx -35
+addx 1
+addx 24
+addx -19
+addx 1
+addx 16
+addx -11
+noop
+noop
+addx 21
+addx -15
+noop
+noop
+addx -3
+addx 9
+addx 1
+addx -3
+addx 8
+addx 1
+addx 5
+noop
+noop
+noop
+noop
+noop
+addx -36
+noop
+addx 1
+addx 7
+noop
+noop
+noop
+addx 2
+addx 6
+noop
+noop
+noop
+noop
+noop
+addx 1
+noop
+noop
+addx 7
+addx 1
+noop
+addx -13
+addx 13
+addx 7
+noop
+addx 1
+addx -33
+noop
+noop
+noop
+addx 2
+noop
+noop
+noop
+addx 8
+noop
+addx -1
+addx 2
+addx 1
+noop
+addx 17
+addx -9
+addx 1
+addx 1
+addx -3
+addx 11
+noop
+noop
+addx 1
+noop
+addx 1
+noop
+noop
+addx -13
+addx -19
+addx 1
+addx 3
+addx 26
+addx -30
+addx 12
+addx -1
+addx 3
+addx 1
+noop
+noop
+noop
+addx -9
+addx 18
+addx 1
+addx 2
+noop
+noop
+addx 9
+noop
+noop
+noop
+addx -1
+addx 2
+addx -37
+addx 1
+addx 3
+noop
+addx 15
+addx -21
+addx 22
+addx -6
+addx 1
+noop
+addx 2
+addx 1
+noop
+addx -10
+noop
+noop
+addx 20
+addx 1
+addx 2
+addx 2
+addx -6
+addx -11
+noop
+noop
+noop
+
+```
+
+The interesting signal strengths can be determined as follows:
+
+
+* During the 20th cycle, register `X` has the value `21`, so the signal strength is 20 \* 21 = *420*. (The 20th cycle occurs in the middle of the second `addx -1`, so the value of register `X` is the starting value, `1`, plus all of the other `addx` values up to that point: 1 + 15 - 11 + 6 - 3 + 5 - 1 - 8 + 13 + 4 = 21.)
+* During the 60th cycle, register `X` has the value `19`, so the signal strength is 60 \* 19 = `*1140*`.
+* During the 100th cycle, register `X` has the value `18`, so the signal strength is 100 \* 18 = `*1800*`.
+* During the 140th cycle, register `X` has the value `21`, so the signal strength is 140 \* 21 = `*2940*`.
+* During the 180th cycle, register `X` has the value `16`, so the signal strength is 180 \* 16 = `*2880*`.
+* During the 220th cycle, register `X` has the value `18`, so the signal strength is 220 \* 18 = `*3960*`.
+
+
+The sum of these signal strengths is `*13140*`.
+
+
+Find the signal strength during the 20th, 60th, 100th, 140th, 180th, and 220th cycles. *What is the sum of these six signal strengths?*
+
+

+ 3 - 0
aoc2022/day10/example.txt

@@ -0,0 +1,3 @@
+noop
+addx 3
+addx -5

+ 139 - 0
aoc2022/day10/input.txt

@@ -0,0 +1,139 @@
+noop
+addx 12
+addx -5
+addx -1
+noop
+addx 4
+noop
+addx 1
+addx 4
+noop
+addx 13
+addx -8
+noop
+addx -19
+addx 24
+addx 1
+noop
+addx 4
+noop
+addx 1
+addx 5
+addx -1
+addx -37
+addx 16
+addx -13
+addx 18
+addx -11
+addx 2
+addx 23
+noop
+addx -18
+addx 9
+addx -8
+addx 2
+addx 5
+addx 2
+addx -21
+addx 26
+noop
+addx -15
+addx 20
+noop
+addx 3
+noop
+addx -38
+addx 3
+noop
+addx 26
+addx -4
+addx -19
+addx 3
+addx 1
+addx 5
+addx 3
+noop
+addx 2
+addx 3
+noop
+addx 2
+noop
+noop
+noop
+noop
+addx 5
+noop
+noop
+noop
+addx 3
+noop
+addx -30
+addx -4
+addx 1
+addx 18
+addx -8
+addx -4
+addx 2
+noop
+addx 7
+noop
+noop
+noop
+noop
+addx 5
+noop
+noop
+addx 5
+addx -2
+addx -20
+addx 27
+addx -20
+addx 25
+addx -2
+addx -35
+noop
+noop
+addx 4
+addx 3
+addx -2
+addx 5
+addx 2
+addx -11
+addx 1
+addx 13
+addx 2
+addx 5
+addx 6
+addx -1
+addx -2
+noop
+addx 7
+addx -2
+addx 6
+addx 1
+addx -21
+addx 22
+addx -38
+addx 5
+addx 3
+addx -1
+noop
+noop
+addx 5
+addx 1
+addx 4
+addx 3
+addx -2
+addx 2
+noop
+addx 7
+addx -1
+addx 2
+addx 4
+addx -10
+addx -19
+addx 35
+addx -1
+noop
+noop
+noop

+ 0 - 0
aoc2022/day10/puzzle.jl


+ 135 - 0
aoc2022/day7/README.md

@@ -0,0 +1,135 @@
+--- Day 7: No Space Left On Device ---
+--------------------------------------
+
+You can hear birds chirping and raindrops hitting leaves as the expedition proceeds. Occasionally, you can even hear much louder sounds in the distance; how big do the animals get out here, anyway?
+
+
+The device the Elves gave you has problems with more than just its communication system. You try to run a system update:
+
+
+
+```
+$ system-update --please --pretty-please-with-sugar-on-top
+Error: No space left on device
+
+```
+
+Perhaps you can delete some files to make space for the update?
+
+
+You browse around the filesystem to assess the situation and save the resulting terminal output (your puzzle input). For example:
+
+
+
+```
+$ cd /
+$ ls
+dir a
+14848514 b.txt
+8504156 c.dat
+dir d
+$ cd a
+$ ls
+dir e
+29116 f
+2557 g
+62596 h.lst
+$ cd e
+$ ls
+584 i
+$ cd ..
+$ cd ..
+$ cd d
+$ ls
+4060174 j
+8033020 d.log
+5626152 d.ext
+7214296 k
+
+```
+
+The filesystem consists of a tree of files (plain data) and directories (which can contain other directories or files). The outermost directory is called `/`. You can navigate around the filesystem, moving into or out of directories and listing the contents of the directory you're currently in.
+
+
+Within the terminal output, lines that begin with `$` are *commands you executed*, very much like some modern computers:
+
+
+* `cd` means *change directory*. This changes which directory is the current directory, but the specific result depends on the argument:
+	+ `cd x` moves *in* one level: it looks in the current directory for the directory named `x` and makes it the current directory.
+	+ `cd ..` moves *out* one level: it finds the directory that contains the current directory, then makes that directory the current directory.
+	+ `cd /` switches the current directory to the outermost directory, `/`.
+* `ls` means *list*. It prints out all of the files and directories immediately contained by the current directory:
+	+ `123 abc` means that the current directory contains a file named `abc` with size `123`.
+	+ `dir xyz` means that the current directory contains a directory named `xyz`.
+
+
+Given the commands and output in the example above, you can determine that the filesystem looks visually like this:
+
+
+
+```
+- / (dir)
+  - a (dir)
+    - e (dir)
+      - i (file, size=584)
+    - f (file, size=29116)
+    - g (file, size=2557)
+    - h.lst (file, size=62596)
+  - b.txt (file, size=14848514)
+  - c.dat (file, size=8504156)
+  - d (dir)
+    - j (file, size=4060174)
+    - d.log (file, size=8033020)
+    - d.ext (file, size=5626152)
+    - k (file, size=7214296)
+
+```
+
+Here, there are four directories: `/` (the outermost directory), `a` and `d` (which are in `/`), and `e` (which is in `a`). These directories also contain files of various sizes.
+
+
+Since the disk is full, your first step should probably be to find directories that are good candidates for deletion. To do this, you need to determine the *total size* of each directory. The total size of a directory is the sum of the sizes of the files it contains, directly or indirectly. (Directories themselves do not count as having any intrinsic size.)
+
+
+The total sizes of the directories above can be found as follows:
+
+
+* The total size of directory `e` is *584* because it contains a single file `i` of size 584 and no other directories.
+* The directory `a` has total size *94853* because it contains files `f` (size 29116), `g` (size 2557), and `h.lst` (size 62596), plus file `i` indirectly (`a` contains `e` which contains `i`).
+* Directory `d` has total size *24933642*.
+* As the outermost directory, `/` contains every file. Its total size is *48381165*, the sum of the size of every file.
+
+
+To begin, find all of the directories with a total size of *at most 100000*, then calculate the sum of their total sizes. In the example above, these directories are `a` and `e`; the sum of their total sizes is `*95437*` (94853 + 584). (As in this example, this process can count files more than once!)
+
+
+Find all of the directories with a total size of at most 100000. *What is the sum of the total sizes of those directories?*
+
+
+--- Part Two ---
+----------------
+
+Now, you're ready to choose a directory to delete.
+
+
+The total disk space available to the filesystem is `*70000000*`. To run the update, you need unused space of at least `*30000000*`. You need to find a directory you can delete that will *free up enough space* to run the update.
+
+
+In the example above, the total size of the outermost directory (and thus the total amount of used space) is `48381165`; this means that the size of the *unused* space must currently be `21618835`, which isn't quite the `30000000` required by the update. Therefore, the update still requires a directory with total size of at least `8381165` to be deleted before it can run.
+
+
+To achieve this, you have the following options:
+
+
+* Delete directory `e`, which would increase unused space by `584`.
+* Delete directory `a`, which would increase unused space by `94853`.
+* Delete directory `d`, which would increase unused space by `24933642`.
+* Delete directory `/`, which would increase unused space by `48381165`.
+
+
+Directories `e` and `a` are both too small; deleting them would not free up enough space. However, directories `d` and `/` are both big enough! Between these, choose the *smallest*: `d`, increasing unused space by `*24933642*`.
+
+
+Find the smallest directory that, if deleted, would free up enough space on the filesystem to run the update. *What is the total size of that directory?*
+
+

+ 23 - 0
aoc2022/day7/example.txt

@@ -0,0 +1,23 @@
+$ cd /
+$ ls
+dir a
+14848514 b.txt
+8504156 c.dat
+dir d
+$ cd a
+$ ls
+dir e
+29116 f
+2557 g
+62596 h.lst
+$ cd e
+$ ls
+584 i
+$ cd ..
+$ cd ..
+$ cd d
+$ ls
+4060174 j
+8033020 d.log
+5626152 d.ext
+7214296 k

+ 1027 - 0
aoc2022/day7/input.txt

@@ -0,0 +1,1027 @@
+$ cd /
+$ ls
+268495 jgfbgjdb
+dir ltcqgnc
+272455 pct.bbd
+200036 phthcq
+174378 qld
+dir rbmstsf
+130541 trhbvp.fmm
+dir twjcmp
+$ cd ltcqgnc
+$ ls
+227634 brjmpbfg.hjh
+dir cmdzcq
+dir dnbf
+203609 fpj
+dir frt
+288222 lcr.nlr
+dir ngm
+dir ngsrlzc
+5927 phrnnw.dzj
+dir shjv
+dir wsvfbb
+$ cd cmdzcq
+$ ls
+37316 cfvhc.qsw
+41839 mgwlr
+dir pfmbt
+281659 tlpqzz
+dir vmd
+189667 zdvj.sbl
+$ cd pfmbt
+$ ls
+120151 bhzsnw.gft
+45035 cfvhc.zpp
+$ cd ..
+$ cd vmd
+$ ls
+dir dnc
+dir rgftffp
+$ cd dnc
+$ ls
+dir dvndwjzs
+216199 fzwrr.ndp
+dir gwhtzlpg
+dir lsfn
+dir lzcv
+237080 qld
+131509 rwhffw.ldj
+84024 wph
+$ cd dvndwjzs
+$ ls
+264750 htjvzrv.plg
+$ cd ..
+$ cd gwhtzlpg
+$ ls
+dir cfvhc
+285900 fpj
+112604 gqng.zww
+188180 phthcq
+dir prgbvj
+$ cd cfvhc
+$ ls
+136528 bbsmm
+$ cd ..
+$ cd prgbvj
+$ ls
+180538 hfgg.fbm
+$ cd ..
+$ cd ..
+$ cd lsfn
+$ ls
+133375 fzwrr.ndp
+242940 gcftj.nlb
+$ cd ..
+$ cd lzcv
+$ ls
+121565 plnqnqq.zwr
+100302 wdmqc
+$ cd ..
+$ cd ..
+$ cd rgftffp
+$ ls
+259406 rwhffw
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd dnbf
+$ ls
+dir bft
+219468 czjvl.brj
+130503 fpj
+120522 rwhffw.hrn
+92338 sngz.qsd
+dir vpmvnmfj
+$ cd bft
+$ ls
+dir zdvj
+$ cd zdvj
+$ ls
+50020 sngz.qsd
+$ cd ..
+$ cd ..
+$ cd vpmvnmfj
+$ ls
+78395 dlch.vfb
+270867 hnmq
+172551 pct.bbd
+186790 phthcq
+65750 sjjlnf.bjn
+$ cd ..
+$ cd ..
+$ cd frt
+$ ls
+dir bbsmm
+dir cfvhc
+22983 dpvmzlv
+dir fptlqh
+290097 fzwrr.ndp
+dir hvwdzbsw
+dir nlm
+57046 pct.bbd
+208565 qld.mms
+261556 wcfvpmz
+$ cd bbsmm
+$ ls
+dir bbsmm
+238522 hmjvg.pfn
+228873 nvvsml.bcg
+dir rwhffw
+dir sgbnzbqt
+$ cd bbsmm
+$ ls
+dir lnz
+dir msmpndgh
+dir ncpbn
+dir wfr
+$ cd lnz
+$ ls
+99970 fjbmpmrz.ldw
+$ cd ..
+$ cd msmpndgh
+$ ls
+dir sfsqwrhg
+$ cd sfsqwrhg
+$ ls
+dir vfqg
+$ cd vfqg
+$ ls
+17855 bbsmm
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd ncpbn
+$ ls
+dir nltglc
+$ cd nltglc
+$ ls
+247577 qld.vjz
+$ cd ..
+$ cd ..
+$ cd wfr
+$ ls
+135424 bbps
+243274 hsvjddff.nfw
+dir prg
+158111 qld.zff
+dir rwhffw
+$ cd prg
+$ ls
+214834 lfpqlt.bdt
+dir nclpwh
+104870 phthcq
+dir trrtpgd
+$ cd nclpwh
+$ ls
+104441 mjjftn.sqt
+$ cd ..
+$ cd trrtpgd
+$ ls
+137542 qld
+$ cd ..
+$ cd ..
+$ cd rwhffw
+$ ls
+dir glsrf
+$ cd glsrf
+$ ls
+189772 phthcq
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd rwhffw
+$ ls
+dir bbsmm
+$ cd bbsmm
+$ ls
+104690 cfvhc.nwc
+$ cd ..
+$ cd ..
+$ cd sgbnzbqt
+$ ls
+191204 cfvhc.jnv
+127263 vwfbr
+$ cd ..
+$ cd ..
+$ cd cfvhc
+$ ls
+72894 bbsmm.dns
+$ cd ..
+$ cd fptlqh
+$ ls
+dir bbsmm
+dir bdvp
+162052 vnnjfh.stw
+dir zshvq
+$ cd bbsmm
+$ ls
+dir bbsmm
+dir pchdq
+dir rwhffw
+$ cd bbsmm
+$ ls
+174590 bbsmm
+45636 fpj
+102831 qld
+dir vpwcmgq
+229136 zdvj.rtw
+dir znw
+$ cd vpwcmgq
+$ ls
+dir cfvhc
+dir jvd
+dir zdvj
+$ cd cfvhc
+$ ls
+55907 ccvdlc
+272581 fpj
+29765 phthcq
+$ cd ..
+$ cd jvd
+$ ls
+dir cfvhc
+$ cd cfvhc
+$ ls
+289471 cjzwdvs.gtn
+$ cd ..
+$ cd ..
+$ cd zdvj
+$ ls
+98507 cmldvpnc.qtl
+$ cd ..
+$ cd ..
+$ cd znw
+$ ls
+dir zdvj
+$ cd zdvj
+$ ls
+46012 wrgvln.lmf
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd pchdq
+$ ls
+dir cbssm
+98102 cfvhc
+259488 pct.bbd
+dir rwhffw
+7541 sngz.qsd
+167971 wvgrzn.bds
+$ cd cbssm
+$ ls
+45025 bbsmm
+22500 fpj
+$ cd ..
+$ cd rwhffw
+$ ls
+dir fncszbm
+166012 phthcq
+165925 rbs
+171350 tsbv.zws
+$ cd fncszbm
+$ ls
+dir wzrlzvm
+$ cd wzrlzvm
+$ ls
+191811 qzzs
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd rwhffw
+$ ls
+218844 dnbmcbr.wrc
+201091 mmpvsgjv.wgs
+dir mzt
+223628 pct.bbd
+dir qftlpdt
+56441 sngz.qsd
+33730 zdvj.jfs
+$ cd mzt
+$ ls
+25768 sngz.qsd
+283843 vjrmbw.jcs
+$ cd ..
+$ cd qftlpdt
+$ ls
+287536 mzhmjrg
+223797 pcp
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd bdvp
+$ ls
+dir lnvvwlm
+$ cd lnvvwlm
+$ ls
+210345 zll.scl
+$ cd ..
+$ cd ..
+$ cd zshvq
+$ ls
+251997 cfvhc.mcr
+220501 pct.bbd
+$ cd ..
+$ cd ..
+$ cd hvwdzbsw
+$ ls
+dir cfvhc
+21816 fpj
+251732 vcfcwjh.pjh
+187137 zdvj.bzd
+dir zgprrg
+$ cd cfvhc
+$ ls
+99722 zgq.bbh
+$ cd ..
+$ cd zgprrg
+$ ls
+dir brzpsnjl
+$ cd brzpsnjl
+$ ls
+dir qld
+$ cd qld
+$ ls
+30055 phqdjs.zwv
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd nlm
+$ ls
+176700 fzwrr.ndp
+256184 pct.bbd
+25442 qhngw.jwm
+dir rwhffw
+160900 wqr.wdn
+$ cd rwhffw
+$ ls
+240085 pcjjgjcr
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd ngm
+$ ls
+118461 bbsmm
+dir czjzwl
+dir gjwws
+43114 nwvltczv.jpf
+dir qjpgzsj
+145909 rjdzrjzc.fdr
+dir tvmpgrq
+75554 zdmfhpwz.rhc
+dir zdvj
+196704 zdvj.nfm
+$ cd czjzwl
+$ ls
+dir btnsjtl
+dir cfvhc
+100911 cfvhc.mqg
+dir gljbgjq
+247017 jmrq
+dir qld
+$ cd btnsjtl
+$ ls
+76658 pmgnqr
+$ cd ..
+$ cd cfvhc
+$ ls
+189214 jvrcttm
+265333 mmgd.sbn
+$ cd ..
+$ cd gljbgjq
+$ ls
+dir ccqsnp
+dir fng
+104525 fzwrr.ndp
+31517 gmqhmwj.rbs
+122232 htddmr.wjm
+51362 rtlnr.mwh
+42769 rvddl
+$ cd ccqsnp
+$ ls
+192021 cfvhc.lww
+dir mbmsfgtb
+222388 nvgppmv
+dir qbpnbsv
+$ cd mbmsfgtb
+$ ls
+104492 jfwl.jlv
+273739 phthcq
+238815 rwhffw.tjp
+$ cd ..
+$ cd qbpnbsv
+$ ls
+176577 tlqnmmsc.gpt
+$ cd ..
+$ cd ..
+$ cd fng
+$ ls
+243298 cfvhc.pvb
+54364 fbrtb.hqd
+dir hvhwh
+dir rtcsp
+$ cd hvhwh
+$ ls
+87079 zdvj.gfq
+$ cd ..
+$ cd rtcsp
+$ ls
+dir zdvj
+$ cd zdvj
+$ ls
+288617 rwhffw.lzl
+161000 sngz.qsd
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd qld
+$ ls
+113942 bbsmm.msn
+239442 cchgv.mtd
+181920 nnlfh.gwz
+274766 rqtvc.frp
+$ cd ..
+$ cd ..
+$ cd gjwws
+$ ls
+dir bpzsc
+dir cfvhc
+dir fsnf
+dir zdvj
+$ cd bpzsc
+$ ls
+88033 cndwmvj.pzm
+275297 hslg.smz
+dir qld
+25067 qvntlcd.nzs
+$ cd qld
+$ ls
+240593 bbsmm.bgn
+dir dpqgcc
+277540 fpj
+dir qld
+$ cd dpqgcc
+$ ls
+dir rhqvcfd
+$ cd rhqvcfd
+$ ls
+199386 fzwrr.ndp
+$ cd ..
+$ cd ..
+$ cd qld
+$ ls
+269177 cjrc.dvq
+21631 fpj
+263874 pct.bbd
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd cfvhc
+$ ls
+dir nzd
+$ cd nzd
+$ ls
+273225 qld.jmn
+$ cd ..
+$ cd ..
+$ cd fsnf
+$ ls
+17887 fzwrr.ndp
+$ cd ..
+$ cd zdvj
+$ ls
+160076 rwhffw.trf
+$ cd ..
+$ cd ..
+$ cd qjpgzsj
+$ ls
+227586 njqbnz.hwl
+239840 zdvj.qcp
+$ cd ..
+$ cd tvmpgrq
+$ ls
+dir hdrsmnvc
+dir psrjr
+$ cd hdrsmnvc
+$ ls
+dir rjm
+dir zdvj
+$ cd rjm
+$ ls
+244666 bzvmdcm
+$ cd ..
+$ cd zdvj
+$ ls
+132943 gnz.ntd
+$ cd ..
+$ cd ..
+$ cd psrjr
+$ ls
+dir nfvllp
+dir plfgfs
+94173 qmdhr
+3133 swjh.rbg
+dir zmp
+$ cd nfvllp
+$ ls
+39707 zbsm.vsd
+$ cd ..
+$ cd plfgfs
+$ ls
+186603 cfvhc.sgb
+183833 ljn
+$ cd ..
+$ cd zmp
+$ ls
+123313 fzwrr.ndp
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd zdvj
+$ ls
+dir hzzs
+230054 nhcvn.dfl
+dir rgwfsqdc
+dir zwtjr
+$ cd hzzs
+$ ls
+58585 cbfhrf.vqn
+dir cfvhc
+dir fbzpmc
+dir fdtjp
+28182 fzwrr.ndp
+35581 nzwndl.zzs
+dir pmrv
+253508 qgdnnl.tqq
+$ cd cfvhc
+$ ls
+256186 nlgzqw.frl
+$ cd ..
+$ cd fbzpmc
+$ ls
+dir cfvhc
+$ cd cfvhc
+$ ls
+193322 rwhffw.vwc
+$ cd ..
+$ cd ..
+$ cd fdtjp
+$ ls
+dir bbsmm
+140927 fzwrr.ndp
+dir lcmpbs
+94413 mpnfgpsm
+dir qvrd
+247202 tlp
+$ cd bbsmm
+$ ls
+206896 clsqp.hbr
+$ cd ..
+$ cd lcmpbs
+$ ls
+dir bbsmm
+dir cfvhc
+dir rplqgm
+dir tmh
+dir zdvj
+$ cd bbsmm
+$ ls
+235479 sngz.qsd
+$ cd ..
+$ cd cfvhc
+$ ls
+285029 fpj
+29405 mhpr.czj
+$ cd ..
+$ cd rplqgm
+$ ls
+dir bbsmm
+dir cfvhc
+dir mwhf
+$ cd bbsmm
+$ ls
+257187 hsldvt.jdt
+186098 pct.bbd
+$ cd ..
+$ cd cfvhc
+$ ls
+dir rfw
+$ cd rfw
+$ ls
+254454 fzf.ltl
+$ cd ..
+$ cd ..
+$ cd mwhf
+$ ls
+3915 dtcjptnd
+116218 fzwrr.ndp
+$ cd ..
+$ cd ..
+$ cd tmh
+$ ls
+49016 ljsvgl.npd
+258257 mlfq.rrr
+$ cd ..
+$ cd zdvj
+$ ls
+dir jjj
+154441 lcpvwhp.mpq
+$ cd jjj
+$ ls
+31731 bbsmm.mhb
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd qvrd
+$ ls
+199473 pgqbpq
+$ cd ..
+$ cd ..
+$ cd pmrv
+$ ls
+120831 cfvhc.btv
+$ cd ..
+$ cd ..
+$ cd rgwfsqdc
+$ ls
+281099 cfvhc.trc
+119483 mntqrvw.qwz
+275572 zhphps
+$ cd ..
+$ cd zwtjr
+$ ls
+187404 gwjsj
+230074 qmr
+212641 wdhl.dfl
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd ngsrlzc
+$ ls
+164729 lnc.mdg
+33748 pct.bbd
+119803 rfst.blw
+dir zdvj
+$ cd zdvj
+$ ls
+dir bbsmm
+251550 sngz.qsd
+120940 zlmcvg
+$ cd bbsmm
+$ ls
+206509 bsddjdv
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd shjv
+$ ls
+17754 lqqz.qmf
+265175 rdmsqztj.lnt
+$ cd ..
+$ cd wsvfbb
+$ ls
+dir bhbb
+271856 fzwrr.ndp
+114188 hgfjq.jvn
+dir jgnl
+dir qnddp
+51700 rwdnzwhv.vtr
+$ cd bhbb
+$ ls
+107036 rwhffw.pld
+$ cd ..
+$ cd jgnl
+$ ls
+dir qld
+$ cd qld
+$ ls
+39294 rbsvwh
+$ cd ..
+$ cd ..
+$ cd qnddp
+$ ls
+dir vzmrb
+58723 wcbz.dwh
+$ cd vzmrb
+$ ls
+203361 rvrbgd.cpw
+167876 zgpdcb.rql
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd rbmstsf
+$ ls
+dir bbsmm
+dir cfvhc
+63250 hcdlfmt.ccg
+dir mgzl
+dir ngflwbmp
+dir shvjprl
+123258 spqchmj.wpv
+$ cd bbsmm
+$ ls
+dir cfvhc
+dir gtvszgs
+6558 nzdhg
+121160 qld
+dir rfjfp
+dir rwhffw
+dir sbfshph
+$ cd cfvhc
+$ ls
+dir btmbjrw
+dir pzq
+133178 sngz.qsd
+$ cd btmbjrw
+$ ls
+dir ftpvz
+dir tjflfshs
+dir wvncjmf
+$ cd ftpvz
+$ ls
+dir lqlrh
+$ cd lqlrh
+$ ls
+114380 pcn.cbn
+$ cd ..
+$ cd ..
+$ cd tjflfshs
+$ ls
+274555 bbsmm.wpr
+$ cd ..
+$ cd wvncjmf
+$ ls
+dir nnrqcfmm
+$ cd nnrqcfmm
+$ ls
+217188 pct.bbd
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd pzq
+$ ls
+89797 sngz.qsd
+255100 thg
+$ cd ..
+$ cd ..
+$ cd gtvszgs
+$ ls
+87661 sngz.qsd
+$ cd ..
+$ cd rfjfp
+$ ls
+130164 cfvhc.rbt
+dir lhf
+dir qld
+20799 qld.gts
+dir qwzj
+150977 sngz.qsd
+$ cd lhf
+$ ls
+125848 lvgv.jtg
+81087 mdcw.rbv
+80091 qld
+dir rmsggp
+49093 thf.jnh
+dir tmf
+dir zdvj
+$ cd rmsggp
+$ ls
+dir fznsmbq
+dir lhghnn
+dir zdvj
+$ cd fznsmbq
+$ ls
+dir wqzwsspq
+dir zdvj
+$ cd wqzwsspq
+$ ls
+dir gbzfpfq
+$ cd gbzfpfq
+$ ls
+185410 pct.bbd
+$ cd ..
+$ cd ..
+$ cd zdvj
+$ ls
+140384 pct.bbd
+$ cd ..
+$ cd ..
+$ cd lhghnn
+$ ls
+36868 fpj
+181925 pct.bbd
+$ cd ..
+$ cd zdvj
+$ ls
+256916 bbsmm.mtr
+dir rwhffw
+75846 rwztfcj.qns
+$ cd rwhffw
+$ ls
+234834 bbsmm.gtp
+140315 pbwqrps
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd tmf
+$ ls
+88583 dhndg
+52796 qld.mlp
+$ cd ..
+$ cd zdvj
+$ ls
+8822 pct.bbd
+221658 sngz.qsd
+$ cd ..
+$ cd ..
+$ cd qld
+$ ls
+119026 dfc.bgr
+87684 fzwrr.ndp
+dir zdvj
+212120 zdvj.jhw
+$ cd zdvj
+$ ls
+dir cfvhc
+169434 mhlpvf.vjz
+$ cd cfvhc
+$ ls
+243919 brtvv
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd qwzj
+$ ls
+101395 qcjvs.mjs
+$ cd ..
+$ cd ..
+$ cd rwhffw
+$ ls
+94012 fzwrr.ndp
+205816 hqrgfm.wwt
+dir lzbmzw
+155203 qjv
+$ cd lzbmzw
+$ ls
+dir dfrdczdj
+$ cd dfrdczdj
+$ ls
+126459 tphtshwc
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd sbfshph
+$ ls
+229389 ccbgcv
+135997 cfvhc.ctl
+119490 rwhffw.pqp
+94530 vjtjz.cfs
+$ cd ..
+$ cd ..
+$ cd cfvhc
+$ ls
+dir cmr
+dir jvh
+dir mjs
+$ cd cmr
+$ ls
+227026 fpj
+$ cd ..
+$ cd jvh
+$ ls
+dir qld
+$ cd qld
+$ ls
+96968 phthcq
+$ cd ..
+$ cd ..
+$ cd mjs
+$ ls
+98117 qld.ftd
+$ cd ..
+$ cd ..
+$ cd mgzl
+$ ls
+198793 nfvnfqn.zwd
+$ cd ..
+$ cd ngflwbmp
+$ ls
+dir bbsmm
+dir jthnmqs
+137176 nrn
+80344 ntbq.ssw
+133166 phthcq
+210691 sngz.qsd
+255501 vgwn.gqr
+dir zdvj
+$ cd bbsmm
+$ ls
+98501 npwwzjgt
+134593 sngz.qsd
+46020 tjszcpm.brs
+213591 zdvj.sgj
+$ cd ..
+$ cd jthnmqs
+$ ls
+dir bbsmm
+dir cfdbp
+dir dpwqmbw
+67233 lzz.tmg
+21344 pzvjlt.qdb
+dir rwhffw
+dir sdtntw
+268059 vwhqh
+dir zdvj
+$ cd bbsmm
+$ ls
+263767 fpj
+46528 tpq.wtb
+$ cd ..
+$ cd cfdbp
+$ ls
+dir grczc
+$ cd grczc
+$ ls
+241829 vnnjnz.nww
+$ cd ..
+$ cd ..
+$ cd dpwqmbw
+$ ls
+287899 pct.bbd
+$ cd ..
+$ cd rwhffw
+$ ls
+41741 ffsqr.cwc
+dir ffzc
+dir nrs
+279620 qchg
+$ cd ffzc
+$ ls
+10583 pct.bbd
+$ cd ..
+$ cd nrs
+$ ls
+195239 zdvj.npp
+$ cd ..
+$ cd ..
+$ cd sdtntw
+$ ls
+245601 fpj
+9552 lgftw.ntj
+$ cd ..
+$ cd zdvj
+$ ls
+dir smjvcql
+$ cd smjvcql
+$ ls
+dir qcqljj
+$ cd qcqljj
+$ ls
+286791 fhm
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd zdvj
+$ ls
+dir bcghd
+57663 fzwrr.ndp
+177473 gzpfmsz.tnw
+53543 pswpr
+251188 sngz.qsd
+dir snqjl
+$ cd bcghd
+$ ls
+106732 sjvhjd
+dir vtgsnb
+$ cd vtgsnb
+$ ls
+dir gtj
+$ cd gtj
+$ ls
+151689 nncsjvn.vhd
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd snqjl
+$ ls
+104993 bjjqd.pqv
+233367 fzwrr.ndp
+11942 sngz.qsd
+$ cd ..
+$ cd ..
+$ cd ..
+$ cd shvjprl
+$ ls
+130539 jpzsdjw.hlz
+$ cd ..
+$ cd ..
+$ cd twjcmp
+$ ls
+86053 pct.bbd

+ 77 - 0
aoc2022/day7/puzzle.jl

@@ -0,0 +1,77 @@
+using BenchmarkTools
+using DataStructures
+using AbstractTrees
+
+inputfile = joinpath(@__DIR__, "example.txt")
+
+input = readlines(inputfile)
+
+struct Elemen
+    name::String
+    size::Int64
+    loeqwe
+end
+
+struct TreeNode
+    name::String
+    size::In
+    children::Vector{Int}
+end
+
+function read_files_size(input, Directory, line_number)
+    println("we are in the $folder")
+    println(input[line_number])
+    dir = Dict()
+    dir[folder] = Dict()
+    dir["size"] = 0
+    # dir["size"] = 0
+    while line_number <= length(input) && !startswith(input[line_number], "\$ cd")
+        println(input[line_number])
+        if startswith(input[line_number], "\$ ls")
+            line_number += 1
+        elseif startswith(input[line_number], "dir")
+            # dir[folder][input[line_number][5:end]] = Dict()
+            # dir[folder][input[line_number][5:end]]["size"] = 0
+            line_number += 1
+        else
+            dir["size"] += parse(Int, split(input[line_number])[1])
+            line_number += 1
+        end
+    end
+    if startswith(input[line_number], "\$ cd")
+        println(input[line_number])
+        if input[line_number][6:end] == ".."
+            return dir
+        else
+            dir[folder] = read_files_size(input, input[line_number][6:end], line_number + 1)
+        end
+    end
+    return dir
+end
+
+# fs = read_files_size(input, "/", 2)
+
+
+
+# -------------
+
+stack_based_solution() = begin
+    stack = []; sizes = []
+    for line in input
+        if line == "\$ cd .."
+            size = pop!(stack)
+            append!(sizes, size)
+            stack[end] += size
+        elseif startswith(line, "\$ cd")
+            append!(stack, 0)
+        elseif isnumeric(line[1])
+            stack[end] += parse(Int, split(line)[1])
+        end
+    end
+    s = vcat(sizes, stack)
+    f = s |> x->filter(y -> y < 100_000, x) |> sum
+    s = s |> x->filter(y -> y >= maximum(x) - 40_000_000, x) |> minimum
+    f, s
+end
+
+# @btime stack_based_solution()

+ 105 - 0
aoc2022/day8/README.md

@@ -0,0 +1,105 @@
+--- Day 8: Treetop Tree House ---
+---------------------------------
+
+The expedition comes across a peculiar patch of tall trees all planted carefully in a grid. The Elves explain that a previous expedition planted these trees as a reforestation effort. Now, they're curious if this would be a good location for a [tree house](https://en.wikipedia.org/wiki/Tree_house).
+
+
+First, determine whether there is enough tree cover here to keep a tree house *hidden*. To do this, you need to count the number of trees that are *visible from outside the grid* when looking directly along a row or column.
+
+
+The Elves have already launched a [quadcopter](https://en.wikipedia.org/wiki/Quadcopter) to generate a map with the height of each tree (your puzzle input). For example:
+
+
+
+```
+30373
+25512
+65332
+33549
+35390
+
+```
+
+Each tree is represented as a single digit whose value is its height, where `0` is the shortest and `9` is the tallest.
+
+
+A tree is *visible* if all of the other trees between it and an edge of the grid are *shorter* than it. Only consider trees in the same row or column; that is, only look up, down, left, or right from any given tree.
+
+
+All of the trees around the edge of the grid are *visible* - since they are already on the edge, there are no trees to block the view. In this example, that only leaves the *interior nine trees* to consider:
+
+
+* The top-left `5` is *visible* from the left and top. (It isn't visible from the right or bottom since other trees of height `5` are in the way.)
+* The top-middle `5` is *visible* from the top and right.
+* The top-right `1` is not visible from any direction; for it to be visible, there would need to only be trees of height *0* between it and an edge.
+* The left-middle `5` is *visible*, but only from the right.
+* The center `3` is not visible from any direction; for it to be visible, there would need to be only trees of at most height `2` between it and an edge.
+* The right-middle `3` is *visible* from the right.
+* In the bottom row, the middle `5` is *visible*, but the `3` and `4` are not.
+
+
+With 16 trees visible on the edge and another 5 visible in the interior, a total of `*21*` trees are visible in this arrangement.
+
+
+Consider your map; *how many trees are visible from outside the grid?*
+
+
+--- Part Two ---
+----------------
+
+Content with the amount of tree cover available, the Elves just need to know the best spot to build their tree house: they would like to be able to see a lot of *trees*.
+
+
+To measure the viewing distance from a given tree, look up, down, left, and right from that tree; stop if you reach an edge or at the first tree that is the same height or taller than the tree under consideration. (If a tree is right on the edge, at least one of its viewing distances will be zero.)
+
+
+The Elves don't care about distant trees taller than those found by the rules above; the proposed tree house has large [eaves](https://en.wikipedia.org/wiki/Eaves) to keep it dry, so they wouldn't be able to see higher than the tree house anyway.
+
+
+In the example above, consider the middle `5` in the second row:
+
+
+
+```
+30373
+25*5*12
+65332
+33549
+35390
+
+```
+
+* Looking up, its view is not blocked; it can see `*1*` tree (of height `3`).
+* Looking left, its view is blocked immediately; it can see only `*1*` tree (of height `5`, right next to it).
+* Looking right, its view is not blocked; it can see `*2*` trees.
+* Looking down, its view is blocked eventually; it can see `*2*` trees (one of height `3`, then the tree of height `5` that blocks its view).
+
+
+A tree's *scenic score* is found by *multiplying together* its viewing distance in each of the four directions. For this tree, this is `*4*` (found by multiplying `1 * 1 * 2 * 2`).
+
+
+However, you can do even better: consider the tree of height `5` in the middle of the fourth row:
+
+
+
+```
+30373
+25512
+65332
+33*5*49
+35390
+
+```
+
+* Looking up, its view is blocked at `*2*` trees (by another tree with a height of `5`).
+* Looking left, its view is not blocked; it can see `*2*` trees.
+* Looking down, its view is also not blocked; it can see `*1*` tree.
+* Looking right, its view is blocked at `*2*` trees (by a massive tree of height `9`).
+
+
+This tree's scenic score is `*8*` (`2 * 2 * 1 * 2`); this is the ideal spot for the tree house.
+
+
+Consider each tree on your map. *What is the highest scenic score possible for any tree?*
+
+

+ 5 - 0
aoc2022/day8/example.txt

@@ -0,0 +1,5 @@
+30373
+25512
+65332
+33549
+35390

+ 99 - 0
aoc2022/day8/input.txt

@@ -0,0 +1,99 @@
+012333020214114313144335140322135024300001316000003021661021402203334043530025242334031301420211203
+321322012210411202411222140105022243546162656353412656161345264013320002410502113123133103110310103
+310210132224000411310104525310511405443133224046520106440616614533122315022301300411313020011332300
+110323333230014215250313221045002512112261052025342454530231160413245115333251322342333412433120102
+302213324202412332155202503302524626556400052214212641324461031135305413423041244422510140230321312
+010023423144023401003025051434640066563416536123365135513001306660416551415320410020240213233202331
+311234404232454320341123503603531113200662245554021016446534016262314064255354540320005413431421200
+314232412000545115540043043634450421615432046054647252234164313310410323445011400003213041002002320
+034113340142203203004355430101052264163313247513511315375241515160326235063421225412234125320124000
+411034144310552520143455432031220546472513462754535442545363615142624461264533160145222552533422021
+334441412541044302251305013423023025774774257213114144621225452464726556360513503121223044013114041
+222330413534054310525113110011525167135617672735131771327411457416711230361431215424210521230040114
+332310444122421412232252156331125234756364256762776565347752661722446654121033012403204143030311014
+404312314334553146463200563045242534625122727433217756333536325156522565321522545324601224133023440
+421100002313521532412422321713763615561554772744784731336731615231123743374053611560362033001513023
+200102152032540226040030177732712415653745765876485273823837347572443127611750631502225530411342330
+410423514054203365650312725567674624158846435428334587483737742612334765255470504156112141004502421
+113025154303556043166667162446476776455424366623755476563626877446442313641527644263441121510154014
+313430333202606403104274652427265688775373752844865647528458475788622424417623676114061601555141402
+021552332314606144362257746716372548224568882565885862244885467638788312441713715526412611022232535
+025114520212115424373363654436845488466568337385783556585243347743864732757331421441235636541413155
+312255412551540256344252365414473235667335268766638468583387565634455653314466575545222024230530040
+453500530514132413653313151765653365285756753844656585846247774664834875672432443621014120545343314
+454024420122242463356217634425623524537573395649838897958673923448848545275753413272566621001233344
+145012524366010075724311463673523542238586946939476776636854357834262845657333642776761251534042303
+155155231133430614634162758583758388963678555898887665689677595864247572443477737516362551465012110
+252514654225361426435136225785682878696567839368746375463375764548328447338551526477626225320153155
+150055054454627766547238446465537734789698698866595684343969338444555646688453127237471046501011045
+133252664114343761257745484864785657876846789475396763549554793374964636287455445725273210636531041
+344104402103437576324278833544534594563673747887474766447553944647737375628385484641172350644411321
+430134422214773667742573638352693695438389564584445756458474957593784966275523875255316265516101100
+533150525034576714162324353557837655884344776865944946555857576664798943742248645241736442414141112
+242213613047457414582235822258557398858889698595769664777675577775677555553638678445736552044254431
+323305614121511775646753278754568743566649689577595966547655874896435957732283588717753511440154302
+542123543443255163654667588896594536954967686497957447567888577554649334959584532676476734161644532
+442653560444341164783355333696663385448984448844786547847698964589946555585835268752563457632525010
+324125242272715753628474598956633765546456844949785599465749768895989866388463837382552726244303404
+555330352235634737655735268487577685445997696975569789555457477845648639798573683582745276244562610
+324055612253617537782843576778377786554489985786978567869654885698568567639972238774265314774663261
+164652136512215423474632794857387455445887887675556756788698597796644573797777467623415536563453261
+310103137473761654443426387945746795475476887977855699675955759884685435943466757466244432445154036
+350015236761172468846873376793355977976775678667978965867856696748985673749778627472357757273255103
+146040165577233444334739983493459695956589656766996579955976855497795766575598358573282532523253335
+356520006445263477668475387795548678679768588798968757879588699874645797938763564558761665662604436
+164663513416711728743344393745578664899975785668897899787699987797996449475647326628774552556022346
+211166362617475324584699785799878678769597699968787879668967879578856876833636486744474127441523605
+203664657351411636443497994866776566869878956989667968876758586744584599575353938238524361155314316
+134465031352733732464549948487999957755659586867879678886689975558789588455849833786221237163620214
+215654156734275447668588859899789648986978856998996786976656988574567949798987785383234417542306653
+151365445356257527876376435794758697597797967686966699687965755775544587754857656675336527653762210
+543022373667167854526489386865986968558686789988778897879776989667556659836586865775542641375403362
+212543042216335826467235374687486586965796698999979686689859655776654966438999773642332515125703450
+211031276522338557277249548476589654776597597767987886679969859568869744995948567355573357137652023
+166406133417764856327735497376758686576965779888996797699599957576768584875959662637846137217102025
+414445035265674834662489759364789976989975689877698877889699997585547947566645767258557662231240622
+655311241256577636757339967974565874875699876776667866896875767946869457555636345244666511271046361
+553201421415676732842498649739497447698566955797878767997955777868488965478834973224256173567416105
+260222144752515884224879637674446579747988678758887878997999677566458975968475534774844275663040044
+431102026442125554836829575568699995788765886989778987699995875578667685964375434755382772363156546
+101002217222114786567644764573984775785985877698878877576578569459658885449433236374676344234516154
+454030165653557776864279587638369777786979699975887975585666547868474467977969468422812453524222401
+542505234363616277227623658997637468875786597857559667858877547775487854853854378866221211162514133
+063113651144755784883647478973657485759565878578677657967879749755488996858444853532314525376401025
+050352002767617173552336846454638748676798886958588758555665988446988577945978235237537435765240644
+412011412641323325274532665534534947874744448747588867884768866589954756984545755664151423250626312
+106513213427155151326354223537558535947749755696968994854966555686946349537262628847254341341436621
+413441256632717343228643875697857543984775977999784467576745758596656545745462783273175114503432464
+532253615536153317442822572964435638499566658949857968764664969854847397695436687473342637336010103
+421406220252416634385786888744695778954955686488567445889585974635845793665853538625635132464243130
+130251550466371762444748735777566978978977565665957569679888684987854897464856265511774175261150332
+034360434041332256654673765576465956887357665854768944886864694949463754776226825133257536213523542
+340233063550374361333778846525466598765973957694774785674634784849379448488632773244414366151153154
+232354606362022313112527654365458586797678776463946373789846667753474862337853333111432231352566103
+434241421342506333764438286224482895843475668843958988934546763746965735536274733766774423161211511
+335515030630613614622621754762833857748555798874655739884575744786838882773882317654333646146642214
+204203545101110262776274655678866234577653648697448369387735394992537236848632474156552310413232534
+111311354652160114535431135387728267457337686968857434594755653583462676365456727452453631246534525
+134205520435634254245247753678777522664597856356976999878956568348738548762113563776414406666245124
+214332136602256224223343446238877853353335747445698638696638286428733765216637134550252505462325324
+015551035553112164165263153267576536224332727548474628863358862337744543444524574331011324214403332
+200503534162065320314275777742667655437464563832378873876347757244723867167344354753556211540213455
+405042050036500234141374714373313638582443534455385433678457335288348565714457633064136441432142502
+211011121411621536400675757521332688725324852754267556576773323885437636524237620366321355404100050
+120224132234602420306223327672557673252345628822457866355427323455262564765445300055254511212251251
+433432243544033016103630312773432525248723437748783648456283744722147471331125623205644553414540440
+434414021103512526235406014612743356243354657242677745566445435433661127463123003423306314435322214
+223410143402351650363532141671671252567756426727773273234566521222441751631501430123423253042550412
+203200453304025522335515224571344427741373646762646774235464725463526361532635024341551222312030034
+041203135055054010640465254203127526536654552626232216222456366111737641112352253025403341510240340
+313412332422500031664613225533062516375472216777141413636554765474462061610663642203210001231102333
+402100423533541020334313665014320174427776237345545174471644666457222436032633556352353451321433112
+220244134002333432534210300123320502056445761274646477523246266200064001011302551414000410143002232
+242044020002201321352506245263623221205625534251615624263677712653043502162200213342121454021433210
+102100143234022540125450312625014413561346051457432445151562531526631611434422223051303031102042321
+212102304413452414151142504336066366354621002262444403322216532055026633226431245053222143122433242
+120002320343444332525233532335244100466105444620422536360611504145452044331025152115044331044244303
+100301430413204340531014552335402025020633400206055204550144413055422662024401012530320042240222230
+220122144120304224030114032152003231656506125641631435614445322436263440352340040230123321013001210
+311002103114013110111531002542445223254606426006406106222400065161011323410222244352334031123301213

+ 68 - 0
aoc2022/day8/puzzle.jl

@@ -0,0 +1,68 @@
+using BenchmarkTools
+
+inputfile = joinpath(@__DIR__, "input.txt")
+
+input = readlines(inputfile)
+
+grid = input .|> collect .|> x -> parse.(Int, x)
+
+mgrid = permutedims(reduce(hcat, grid))
+
+solve1(mgrid) = begin
+    fish = zeros(Int, size(mgrid))
+    fish[begin, :] .= 1
+    fish[end, :] .= 1
+    fish[:, begin] .= 1
+    fish[:, end] .= 1
+
+    for i = 2:size(mgrid)[1]-1
+        for j = 2:size(mgrid)[1]-1
+            center = mgrid[i, j]
+            if all(center .> mgrid[begin:i-1, j]) ||
+               all(center .> mgrid[i+1:end, j]) ||
+               all(center .> mgrid[i, begin:j-1]) ||
+               all(center .> mgrid[i, j+1:end])
+                fish[i, j] = 1
+            end
+        end
+    end
+    count(==(1), fish)
+end
+
+solve2(mgrid) = begin
+    fish = zeros(Int, size(mgrid))
+    for i = 2:size(mgrid)[1]-1
+        for j = 2:size(mgrid)[1]-1
+            sl = i + 1
+            score_down = 1
+            center = mgrid[i, j]
+            while center > mgrid[sl, j] && sl <= size(mgrid)[1] - 1
+                sl += 1
+                score_down += 1
+            end
+            score_up = 1
+            sl = i - 1
+            while center > mgrid[sl, j] && sl >= 2
+                sl -= 1
+                score_up += 1
+            end
+            score_right = 1
+            sl = j + 1
+            while center > mgrid[i, sl] && sl <= size(mgrid)[1] - 1
+                score_right += 1
+                sl += 1
+            end
+            score_left = 1
+            sl = j - 1
+            while center > mgrid[i, sl] && sl >= 2
+                score_left += 1
+                sl -= 1
+            end
+            score = score_down * score_left * score_right * score_up
+            fish[i, j] = score
+        end
+    end
+    maximum(fish)
+end
+
+print((solve1(mgrid), solve2(mgrid)))

+ 287 - 0
aoc2022/day9/README.md

@@ -0,0 +1,287 @@
+--- Day 9: Rope Bridge ---
+--------------------------
+
+This rope bridge creaks as you walk along it. You aren't sure how old it is, or whether it can even support your weight.
+
+
+It seems to support the Elves just fine, though. The bridge spans a gorge which was carved out by the massive river far below you.
+
+
+You step carefully; as you do, the ropes stretch and twist. You decide to distract yourself by modeling rope physics; maybe you can even figure out where *not* to step.
+
+
+Consider a rope with a knot at each end; these knots mark the *head* and the *tail* of the rope. If the head moves far enough away from the tail, the tail is pulled toward the head.
+
+
+Due to nebulous reasoning involving [Planck lengths](https://en.wikipedia.org/wiki/Planck_units#Planck_length), you should be able to model the positions of the knots on a two-dimensional grid. Then, by following a hypothetical *series of motions* (your puzzle input) for the head, you can determine how the tail will move.
+
+
+Due to the aforementioned Planck lengths, the rope must be quite short; in fact, the head (`H`) and tail (`T`) must *always be touching* (diagonally adjacent and even overlapping both count as touching):
+
+
+
+```
+....
+.TH.
+....
+
+....
+.H..
+..T.
+....
+
+...
+.H. (H covers T)
+...
+
+```
+
+If the head is ever two steps directly up, down, left, or right from the tail, the tail must also move one step in that direction so it remains close enough:
+
+
+
+```
+.....    .....    .....
+.TH.. -> .T.H. -> ..TH.
+.....    .....    .....
+
+...    ...    ...
+.T.    .T.    ...
+.H. -> ... -> .T.
+...    .H.    .H.
+...    ...    ...
+
+```
+
+Otherwise, if the head and tail aren't touching and aren't in the same row or column, the tail always moves one step diagonally to keep up:
+
+
+
+```
+.....    .....    .....
+.....    ..H..    ..H..
+..H.. -> ..... -> ..T..
+.T...    .T...    .....
+.....    .....    .....
+
+.....    .....    .....
+.....    .....    .....
+..H.. -> ...H. -> ..TH.
+.T...    .T...    .....
+.....    .....    .....
+
+```
+
+You just need to work out where the tail goes as the head follows a series of motions. Assume the head and the tail both start at the same position, overlapping.
+
+
+For example:
+
+
+
+```
+R 4
+U 4
+L 3
+D 1
+R 4
+D 1
+L 5
+R 2
+
+```
+
+This series of motions moves the head *right* four steps, then *up* four steps, then *left* three steps, then *down* one step, and so on. After each step, you'll need to update the position of the tail if the step means the head is no longer adjacent to the tail. Visually, these motions occur as follows (`s` marks the starting position as a reference point):
+
+
+
+```
+== Initial State ==
+
+......
+......
+......
+......
+H.....  (H covers T, s)
+
+== R 4 ==
+
+......
+......
+......
+......
+TH....  (T covers s)
+
+......
+......
+......
+......
+sTH...
+
+......
+......
+......
+......
+s.TH..
+
+......
+......
+......
+......
+s..TH.
+
+== U 4 ==
+
+......
+......
+......
+....H.
+s..T..
+
+......
+......
+....H.
+....T.
+s.....
+
+......
+....H.
+....T.
+......
+s.....
+
+....H.
+....T.
+......
+......
+s.....
+
+== L 3 ==
+
+...H..
+....T.
+......
+......
+s.....
+
+..HT..
+......
+......
+......
+s.....
+
+.HT...
+......
+......
+......
+s.....
+
+== D 1 ==
+
+..T...
+.H....
+......
+......
+s.....
+
+== R 4 ==
+
+..T...
+..H...
+......
+......
+s.....
+
+..T...
+...H..
+......
+......
+s.....
+
+......
+...TH.
+......
+......
+s.....
+
+......
+....TH
+......
+......
+s.....
+
+== D 1 ==
+
+......
+....T.
+.....H
+......
+s.....
+
+== L 5 ==
+
+......
+....T.
+....H.
+......
+s.....
+
+......
+....T.
+...H..
+......
+s.....
+
+......
+......
+..HT..
+......
+s.....
+
+......
+......
+.HT...
+......
+s.....
+
+......
+......
+HT....
+......
+s.....
+
+== R 2 ==
+
+......
+......
+.H....  (H covers T)
+......
+s.....
+
+......
+......
+.TH...
+......
+s.....
+
+```
+
+After simulating the rope, you can count up all of the positions the *tail visited at least once*. In this diagram, `s` again marks the starting position (which the tail also visited) and `#` marks other positions the tail visited:
+
+
+
+```
+..##..
+...##.
+.####.
+....#.
+s###..
+
+```
+
+So, there are `*13*` positions the tail visited at least once.
+
+
+Simulate your complete hypothetical series of motions. *How many positions does the tail of the rope visit at least once?*
+
+

+ 8 - 0
aoc2022/day9/example.txt

@@ -0,0 +1,8 @@
+R 4
+U 4
+L 3
+D 1
+R 4
+D 1
+L 5
+R 2

+ 2000 - 0
aoc2022/day9/input.txt

@@ -0,0 +1,2000 @@
+U 1
+D 1
+L 1
+U 2
+L 1
+D 2
+L 2
+U 2
+L 1
+R 2
+U 2
+D 1
+R 2
+U 1
+R 1
+U 1
+R 1
+U 2
+L 1
+U 2
+D 1
+R 1
+U 2
+D 1
+U 2
+D 2
+U 2
+D 1
+R 1
+D 2
+L 2
+R 2
+L 1
+R 2
+D 2
+L 2
+U 1
+D 2
+R 2
+L 2
+R 2
+D 2
+R 1
+D 1
+L 1
+D 1
+L 2
+D 1
+R 1
+L 1
+U 2
+L 2
+U 1
+D 1
+U 1
+D 1
+L 2
+D 2
+L 2
+U 1
+R 2
+D 1
+U 1
+R 2
+L 1
+R 1
+L 1
+R 2
+L 1
+U 2
+R 1
+L 1
+U 1
+D 2
+R 1
+D 2
+L 1
+U 2
+D 2
+L 2
+U 1
+L 1
+D 1
+L 2
+U 2
+R 2
+U 1
+D 2
+L 1
+D 2
+R 1
+L 1
+R 1
+D 2
+U 1
+R 1
+L 1
+U 2
+R 2
+L 1
+R 2
+L 1
+R 1
+L 2
+U 1
+R 2
+D 2
+U 1
+D 1
+L 2
+D 1
+R 3
+D 1
+L 3
+D 1
+R 2
+D 1
+R 2
+U 3
+L 2
+U 2
+D 2
+L 3
+R 3
+U 3
+R 3
+L 1
+R 2
+L 2
+R 3
+U 2
+D 3
+L 3
+D 1
+R 2
+U 1
+D 2
+U 2
+L 1
+U 2
+R 2
+D 2
+L 3
+D 1
+L 1
+R 1
+D 3
+L 2
+R 2
+L 2
+R 2
+D 1
+R 2
+L 3
+U 1
+R 2
+D 2
+R 1
+D 2
+R 2
+L 3
+U 1
+L 2
+U 1
+D 3
+L 1
+U 1
+D 3
+U 2
+L 1
+U 3
+D 2
+R 2
+U 3
+L 3
+D 1
+U 3
+R 1
+U 2
+L 2
+D 1
+U 1
+D 3
+R 1
+D 3
+U 3
+L 3
+R 2
+D 3
+L 2
+U 3
+L 1
+D 3
+L 2
+D 1
+R 3
+L 1
+R 3
+U 2
+L 3
+D 1
+R 2
+L 1
+U 1
+L 3
+R 3
+U 2
+D 2
+U 2
+R 1
+L 3
+U 3
+L 1
+R 3
+D 3
+L 2
+D 3
+U 1
+L 3
+D 3
+R 2
+U 3
+D 1
+R 1
+L 1
+U 4
+L 2
+U 3
+R 3
+U 1
+D 2
+R 4
+U 1
+L 1
+U 3
+R 2
+D 4
+U 3
+D 1
+U 1
+L 1
+U 3
+R 4
+L 1
+R 4
+L 1
+R 2
+L 4
+D 1
+L 4
+R 2
+D 2
+R 2
+U 1
+D 2
+L 4
+D 1
+R 3
+D 2
+U 3
+D 4
+L 3
+U 2
+R 4
+U 4
+D 2
+L 2
+D 1
+U 3
+L 2
+R 4
+L 1
+U 3
+L 2
+R 3
+U 1
+R 4
+D 3
+L 3
+D 1
+U 4
+L 4
+D 3
+R 1
+L 1
+D 2
+L 1
+R 4
+D 2
+L 3
+D 4
+L 4
+U 2
+D 1
+U 4
+D 4
+U 2
+D 2
+R 4
+L 2
+D 4
+U 2
+L 1
+D 4
+U 3
+D 3
+R 2
+D 1
+U 4
+R 2
+U 3
+D 1
+R 1
+L 1
+D 1
+L 3
+R 4
+U 2
+L 4
+D 3
+L 2
+R 4
+L 3
+U 3
+L 1
+D 4
+R 1
+L 2
+D 1
+R 2
+L 1
+R 4
+L 1
+R 3
+U 2
+D 1
+R 2
+L 1
+D 5
+U 1
+D 2
+R 5
+U 4
+L 1
+D 2
+R 3
+U 2
+D 1
+L 4
+D 5
+R 4
+D 2
+R 3
+D 5
+L 2
+R 5
+U 2
+L 4
+R 4
+U 3
+D 3
+R 1
+U 4
+D 2
+U 2
+L 3
+D 4
+L 4
+D 2
+U 5
+R 1
+U 4
+L 2
+U 3
+R 5
+D 4
+U 5
+R 2
+D 5
+R 3
+U 1
+R 4
+L 3
+D 1
+L 1
+R 5
+L 5
+D 2
+U 5
+D 5
+R 5
+U 3
+D 4
+R 4
+U 2
+L 1
+D 3
+U 3
+R 4
+U 4
+D 1
+L 1
+R 2
+L 5
+R 1
+L 3
+D 1
+U 5
+R 1
+U 4
+D 5
+L 5
+R 2
+L 4
+U 1
+L 5
+D 2
+R 2
+D 1
+R 4
+D 5
+L 3
+D 3
+L 4
+U 5
+L 3
+R 4
+D 4
+R 2
+U 4
+R 4
+D 3
+U 3
+L 3
+R 1
+D 4
+U 1
+R 1
+D 1
+R 4
+D 3
+L 5
+U 1
+D 1
+U 5
+L 5
+D 3
+U 6
+D 5
+U 5
+D 1
+L 5
+D 4
+L 2
+R 6
+U 3
+R 6
+D 6
+U 5
+D 3
+L 1
+R 2
+U 2
+D 4
+U 6
+D 1
+U 1
+D 2
+U 3
+L 1
+U 6
+D 4
+L 6
+U 5
+D 4
+U 3
+R 6
+U 5
+R 2
+U 3
+D 6
+L 5
+U 2
+D 4
+L 4
+D 4
+R 6
+U 4
+L 3
+U 4
+R 6
+D 1
+U 4
+R 1
+L 1
+U 3
+D 6
+L 2
+D 2
+U 3
+R 5
+D 1
+R 3
+U 6
+L 2
+R 2
+U 4
+L 5
+D 4
+U 4
+R 4
+D 5
+L 1
+R 2
+U 4
+L 5
+D 6
+R 2
+L 2
+D 6
+L 1
+R 1
+U 3
+L 4
+D 4
+U 5
+L 3
+D 2
+U 2
+L 1
+R 3
+L 4
+U 6
+L 2
+U 2
+D 3
+L 5
+R 1
+D 1
+U 1
+D 6
+L 6
+D 6
+U 2
+D 6
+L 3
+U 2
+L 6
+D 2
+L 4
+R 5
+D 2
+U 3
+R 1
+D 4
+U 2
+R 5
+D 6
+R 7
+U 5
+L 6
+U 5
+L 2
+R 1
+L 3
+R 6
+U 2
+L 3
+U 7
+R 1
+D 2
+U 4
+R 2
+L 3
+D 2
+U 3
+D 7
+U 2
+L 4
+R 6
+D 5
+R 7
+U 1
+D 3
+U 7
+R 2
+U 4
+D 2
+L 7
+D 2
+U 4
+D 3
+R 4
+U 6
+L 7
+R 7
+L 3
+D 3
+U 1
+L 5
+U 5
+R 2
+U 7
+L 2
+U 2
+D 1
+R 3
+U 1
+L 4
+U 4
+D 4
+U 1
+L 2
+R 5
+D 4
+L 4
+U 3
+R 1
+D 2
+R 7
+D 2
+U 5
+D 1
+U 4
+R 7
+L 4
+R 6
+L 7
+R 2
+D 6
+U 7
+R 1
+D 7
+L 3
+D 2
+L 7
+R 4
+L 2
+D 3
+R 2
+U 6
+L 6
+U 2
+R 2
+U 7
+R 7
+D 5
+U 6
+D 7
+R 6
+D 7
+R 2
+U 7
+L 6
+R 6
+U 1
+D 2
+L 1
+R 3
+D 4
+U 3
+R 6
+D 3
+U 3
+D 5
+L 5
+U 4
+R 6
+D 4
+U 7
+L 3
+U 6
+R 7
+D 8
+R 5
+L 4
+D 2
+L 4
+U 8
+R 2
+D 6
+U 4
+D 6
+U 1
+D 7
+U 7
+L 4
+R 2
+L 7
+D 8
+L 2
+D 7
+R 4
+L 3
+D 8
+R 7
+D 8
+U 7
+D 4
+L 1
+U 1
+D 1
+L 3
+D 4
+L 7
+U 8
+D 2
+R 8
+L 1
+D 8
+L 1
+D 4
+U 1
+R 8
+D 2
+L 6
+D 4
+U 4
+R 1
+U 8
+D 1
+U 8
+R 5
+D 8
+L 7
+D 8
+U 6
+D 2
+R 6
+U 8
+L 5
+U 2
+R 4
+L 2
+D 4
+L 5
+D 4
+R 7
+D 5
+L 4
+R 5
+L 4
+D 6
+L 2
+R 1
+U 8
+R 6
+D 8
+U 2
+R 3
+U 5
+R 2
+D 2
+R 2
+D 4
+U 5
+D 2
+L 2
+U 6
+D 3
+R 8
+U 7
+L 7
+D 2
+U 2
+L 8
+D 5
+U 1
+D 7
+L 6
+D 3
+U 3
+D 5
+R 2
+U 7
+L 3
+U 8
+R 9
+D 9
+U 2
+D 7
+L 1
+R 7
+L 8
+U 3
+D 4
+L 2
+R 2
+D 6
+U 6
+R 5
+U 4
+D 6
+R 7
+D 4
+U 1
+D 6
+R 8
+L 6
+R 7
+D 4
+U 5
+D 2
+R 9
+U 5
+L 9
+D 8
+U 1
+L 7
+R 4
+L 8
+R 6
+U 8
+D 9
+U 8
+D 1
+U 6
+L 2
+R 2
+L 9
+D 2
+R 8
+L 1
+U 1
+L 1
+D 8
+U 7
+L 9
+U 4
+R 2
+U 6
+D 5
+R 1
+L 2
+R 1
+L 7
+R 4
+D 2
+L 1
+U 1
+D 3
+U 4
+R 2
+D 7
+L 4
+U 1
+L 1
+D 8
+U 7
+D 6
+U 8
+L 3
+D 2
+R 8
+U 3
+D 5
+U 5
+D 3
+U 2
+L 1
+R 8
+D 2
+L 4
+U 6
+D 2
+L 7
+U 9
+L 3
+D 1
+U 7
+L 4
+U 3
+L 8
+R 9
+D 2
+L 8
+U 9
+R 3
+D 3
+U 7
+D 9
+R 1
+U 8
+R 4
+L 1
+D 9
+L 6
+U 6
+R 3
+D 4
+U 5
+R 5
+L 3
+R 3
+L 7
+U 7
+R 3
+D 4
+R 3
+L 9
+D 2
+U 1
+L 2
+D 10
+R 4
+D 5
+U 1
+R 9
+L 4
+R 7
+D 10
+U 8
+L 8
+R 7
+L 3
+D 6
+L 8
+D 3
+U 7
+D 2
+L 6
+U 1
+R 5
+D 2
+L 7
+D 3
+L 5
+U 10
+R 2
+U 7
+R 7
+L 3
+U 4
+L 5
+D 9
+L 10
+U 5
+L 8
+R 4
+D 6
+U 9
+R 3
+L 4
+R 10
+L 8
+U 5
+D 10
+L 10
+U 7
+L 7
+R 6
+U 2
+D 10
+R 1
+L 9
+U 2
+R 9
+U 10
+D 5
+U 3
+L 3
+D 9
+R 6
+U 9
+R 3
+L 4
+D 2
+R 6
+D 3
+U 7
+D 6
+U 6
+L 5
+D 5
+R 3
+D 5
+R 5
+D 6
+R 9
+L 9
+D 3
+L 3
+U 4
+L 9
+D 8
+L 1
+D 7
+L 6
+U 9
+R 5
+L 8
+D 4
+R 4
+D 9
+R 7
+D 2
+L 4
+U 10
+R 6
+D 2
+R 9
+U 6
+D 2
+R 7
+L 6
+U 8
+D 6
+U 5
+L 1
+R 3
+D 9
+U 2
+D 9
+L 2
+R 6
+L 4
+U 8
+L 10
+D 11
+L 2
+R 6
+U 9
+L 7
+D 1
+U 10
+R 3
+L 10
+U 1
+R 7
+L 2
+U 3
+D 4
+U 10
+D 8
+R 6
+D 2
+U 7
+L 1
+U 5
+D 3
+U 11
+D 1
+R 9
+U 7
+R 5
+L 6
+U 10
+D 7
+U 2
+D 8
+R 10
+D 10
+U 5
+D 2
+U 4
+R 2
+L 10
+U 8
+L 5
+R 3
+U 6
+R 6
+U 2
+R 8
+L 2
+D 6
+R 11
+D 3
+U 6
+D 6
+R 1
+U 4
+D 8
+L 5
+R 11
+D 3
+U 6
+R 1
+L 7
+D 8
+R 7
+L 6
+R 4
+L 1
+U 4
+R 2
+L 3
+R 4
+U 2
+R 8
+L 7
+U 1
+D 11
+L 5
+U 10
+D 3
+L 4
+D 9
+U 8
+R 10
+L 10
+R 4
+D 1
+U 1
+L 6
+D 11
+L 9
+U 1
+D 1
+L 10
+U 11
+R 4
+L 9
+D 5
+U 6
+L 3
+R 5
+U 4
+R 9
+D 11
+L 5
+U 6
+L 2
+D 8
+R 2
+L 10
+U 9
+D 8
+R 10
+D 5
+U 6
+R 2
+L 11
+D 1
+R 4
+D 6
+U 3
+D 12
+L 3
+D 9
+R 2
+L 9
+U 2
+D 3
+L 2
+D 3
+L 8
+D 9
+U 10
+D 8
+R 11
+U 9
+L 4
+U 8
+L 6
+D 12
+L 5
+U 2
+L 5
+R 5
+U 7
+L 4
+U 1
+L 10
+D 6
+R 3
+L 4
+U 1
+L 3
+D 8
+U 1
+D 6
+L 6
+R 9
+D 7
+U 12
+R 12
+U 12
+L 3
+R 4
+L 3
+D 7
+U 3
+D 12
+U 8
+L 10
+D 11
+R 3
+U 3
+L 11
+U 3
+R 11
+U 6
+R 10
+U 11
+D 4
+R 8
+L 2
+U 3
+D 9
+L 3
+R 7
+D 10
+L 11
+R 9
+L 1
+D 3
+R 1
+D 2
+L 4
+R 4
+L 11
+D 7
+L 7
+U 6
+L 12
+R 2
+L 8
+D 9
+U 5
+L 11
+R 1
+U 12
+R 5
+L 5
+D 11
+R 12
+L 10
+R 8
+D 3
+U 9
+R 6
+L 3
+U 13
+D 13
+L 9
+U 6
+D 6
+U 9
+L 9
+R 4
+L 13
+R 2
+U 10
+L 4
+U 7
+D 8
+U 8
+L 3
+U 10
+L 6
+D 1
+R 10
+U 2
+R 12
+L 5
+R 7
+L 11
+D 1
+R 2
+D 4
+R 5
+L 5
+U 2
+D 10
+U 5
+R 6
+U 10
+R 3
+U 13
+R 9
+D 2
+L 4
+R 11
+U 3
+D 6
+R 10
+D 4
+L 1
+U 4
+D 1
+U 12
+D 5
+L 8
+U 3
+R 11
+U 12
+L 11
+R 8
+L 4
+R 12
+D 3
+L 11
+R 1
+L 12
+R 2
+D 10
+R 10
+L 4
+U 4
+D 4
+U 7
+D 6
+L 9
+R 12
+L 7
+D 2
+R 11
+L 5
+D 8
+L 3
+D 1
+L 5
+R 7
+L 10
+U 9
+R 11
+D 13
+L 12
+R 9
+D 1
+L 2
+D 13
+L 5
+R 10
+D 12
+R 10
+L 13
+R 8
+L 5
+R 9
+U 1
+R 3
+D 4
+U 6
+D 2
+L 6
+U 1
+D 8
+U 9
+D 2
+R 9
+D 10
+U 12
+L 14
+U 4
+L 6
+D 3
+U 7
+R 5
+D 13
+R 1
+D 11
+U 10
+L 1
+U 3
+L 9
+U 2
+L 14
+D 14
+L 11
+R 9
+L 12
+R 10
+D 14
+R 3
+D 10
+R 3
+U 3
+D 13
+L 6
+D 5
+L 7
+U 14
+D 7
+U 13
+L 12
+U 13
+R 7
+L 4
+D 8
+R 3
+U 7
+L 1
+D 14
+U 7
+D 12
+U 12
+D 5
+L 3
+U 5
+D 13
+U 12
+L 9
+R 8
+D 8
+R 4
+U 11
+R 10
+D 8
+L 6
+R 7
+D 12
+U 10
+L 10
+D 8
+L 9
+R 11
+D 8
+L 10
+D 14
+L 6
+R 6
+L 10
+R 10
+U 14
+R 4
+U 1
+R 3
+U 11
+L 3
+R 4
+D 11
+U 12
+D 6
+L 5
+R 3
+D 4
+U 4
+D 10
+R 11
+D 10
+L 2
+D 7
+L 6
+D 2
+R 9
+L 1
+R 3
+D 1
+U 10
+D 14
+L 9
+D 8
+U 7
+D 12
+R 2
+U 3
+D 9
+L 5
+D 8
+R 15
+U 6
+L 10
+R 1
+D 3
+U 5
+R 10
+U 5
+L 1
+U 9
+D 9
+R 8
+D 7
+U 1
+R 12
+U 15
+D 2
+U 9
+L 7
+D 11
+R 10
+U 8
+L 8
+D 2
+L 1
+R 2
+L 11
+D 1
+R 8
+D 3
+L 3
+D 15
+R 9
+U 3
+L 13
+U 3
+D 6
+L 7
+R 8
+D 10
+U 6
+R 15
+D 8
+U 1
+D 2
+R 6
+U 2
+R 5
+L 8
+D 12
+U 1
+L 4
+D 1
+R 5
+L 14
+R 9
+L 9
+U 9
+L 11
+U 8
+R 2
+U 4
+D 2
+R 12
+U 13
+D 10
+L 10
+D 5
+L 9
+R 10
+L 10
+R 14
+L 6
+D 8
+R 4
+D 2
+L 11
+R 1
+U 11
+R 9
+L 13
+D 9
+L 14
+R 15
+U 15
+L 6
+U 3
+D 15
+L 5
+D 4
+U 2
+L 4
+D 7
+L 14
+R 2
+L 5
+U 8
+L 3
+U 10
+R 7
+L 12
+U 13
+L 14
+R 3
+U 13
+L 13
+U 16
+D 10
+R 10
+U 8
+L 4
+R 9
+D 4
+L 4
+U 4
+D 10
+L 11
+R 1
+L 11
+U 11
+R 2
+U 11
+R 7
+L 6
+D 6
+U 11
+L 5
+U 8
+R 8
+L 7
+R 11
+D 2
+R 4
+L 16
+U 10
+D 2
+U 2
+R 13
+U 7
+L 2
+R 7
+U 13
+R 3
+L 7
+R 10
+D 10
+L 3
+R 13
+L 10
+U 11
+L 8
+R 14
+U 7
+D 15
+L 9
+R 6
+L 6
+R 16
+D 10
+L 13
+R 5
+L 7
+D 1
+R 3
+D 16
+U 11
+R 16
+L 15
+U 10
+R 6
+D 7
+R 3
+D 4
+L 1
+D 11
+R 14
+U 16
+L 14
+U 11
+L 16
+R 10
+L 10
+U 16
+R 12
+L 6
+U 3
+R 5
+L 10
+U 3
+D 16
+L 15
+U 8
+L 7
+R 12
+L 2
+U 15
+L 1
+D 9
+U 7
+D 8
+L 2
+R 14
+L 9
+D 2
+U 7
+R 2
+D 8
+U 9
+L 4
+D 9
+U 6
+L 13
+D 15
+L 2
+D 15
+L 10
+R 7
+D 10
+L 4
+U 16
+D 7
+R 8
+D 13
+R 4
+L 5
+U 8
+R 15
+U 10
+R 17
+U 8
+L 5
+D 11
+L 2
+U 13
+D 12
+L 3
+U 4
+R 16
+D 4
+L 5
+D 3
+L 16
+R 16
+L 16
+U 10
+L 13
+R 14
+L 7
+U 3
+D 15
+U 11
+D 8
+L 3
+D 3
+U 6
+D 14
+U 1
+L 3
+D 7
+U 14
+R 17
+U 1
+R 16
+U 11
+R 17
+D 10
+R 8
+D 5
+L 14
+R 1
+L 3
+D 17
+R 4
+U 9
+D 1
+U 13
+R 4
+L 3
+U 9
+R 11
+U 5
+R 5
+D 14
+U 12
+L 7
+R 2
+L 15
+D 17
+R 16
+D 3
+L 8
+D 11
+L 1
+U 2
+D 7
+L 11
+R 14
+L 5
+R 17
+U 11
+L 12
+D 14
+L 11
+D 13
+L 12
+R 1
+D 11
+R 2
+L 2
+D 17
+U 5
+R 4
+D 14
+L 14
+D 9
+L 13
+D 12
+R 2
+L 10
+R 7
+U 11
+L 16
+U 12
+R 9
+U 1
+R 17
+U 4
+L 7
+U 1
+L 7
+R 1
+D 5
+L 8
+U 11
+D 4
+U 5
+L 15
+D 3
+L 6
+R 4
+D 1
+R 9
+L 18
+R 6
+L 6
+U 16
+R 16
+D 16
+L 1
+U 13
+R 16
+D 6
+R 15
+U 8
+D 14
+U 5
+D 16
+U 14
+L 13
+R 18
+L 6
+U 5
+R 14
+U 18
+L 10
+D 3
+U 5
+D 15
+R 1
+L 12
+R 1
+L 9
+U 8
+L 14
+U 9
+L 9
+D 5
+R 3
+L 8
+D 18
+L 13
+D 15
+R 15
+U 4
+D 17
+L 17
+U 9
+R 1
+L 13
+R 8
+D 9
+U 15
+L 11
+D 6
+L 14
+D 6
+L 6
+U 8
+D 18
+U 3
+R 1
+L 18
+U 16
+L 11
+D 6
+L 16
+U 13
+R 15
+U 10
+D 4
+L 3
+D 1
+U 1
+L 9
+U 16
+L 8
+R 8
+D 2
+U 13
+R 15
+U 9
+L 7
+D 11
+R 17
+D 8
+U 9
+R 7
+D 7
+R 6
+L 10
+U 5
+L 3
+D 4
+L 1
+U 15
+R 8
+U 17
+L 2
+R 9
+U 15
+D 7
+R 3
+L 10
+U 18
+L 16
+R 15
+L 1
+R 18
+L 8
+D 15
+U 6
+D 11
+R 11
+U 7
+R 9
+L 10
+D 7
+L 7
+U 13
+R 14
+U 9
+D 13
+R 11
+U 17
+D 13
+R 17
+D 19
+L 9
+U 12
+L 16
+D 9
+U 15
+R 5
+D 13
+L 17
+D 3
+R 18
+D 12
+U 9
+D 13
+R 7
+U 18
+R 1
+U 10
+R 11
+U 15
+L 5
+D 15
+R 10
+D 18
+L 8
+U 4
+D 15
+R 11
+U 11
+D 17
+U 2
+R 6
+U 13
+R 8
+D 9
+U 19
+D 8
+U 5
+D 10
+U 18
+L 7
+D 2
+R 13
+D 11
+R 14
+L 14
+R 11
+U 11
+D 13
+L 4
+R 2
+U 18
+L 4
+D 3
+L 15
+U 6
+R 16
+L 13
+D 3
+U 14
+R 5
+U 15
+L 7
+R 5
+U 11
+L 16
+R 5
+L 1
+U 9
+D 7
+R 8
+L 11
+R 6
+L 16
+U 19
+R 2
+D 10
+L 15
+D 7
+U 19
+D 1
+U 5
+L 3

+ 48 - 0
aoc2022/day9/puzzle.jl

@@ -0,0 +1,48 @@
+using BenchmarkTools
+using MLStyle
+
+inputfile = joinpath(@__DIR__, "input.txt")
+
+input = split.(readlines(inputfile))
+
+h = Dict("i" => 1, "j" => 1)
+t = Dict("i" => 1, "j" => 1)
+maxH = 1
+maxV = 1
+minH = 1
+minV = 1
+
+grid = zeros(Int, 350, 350)
+
+function mark(D, i, j, steps)
+    c = 1
+    if D == "R"
+        while c >= steps
+            
+
+for line in input
+    direction = line[1]
+    steps = parse(Int, line[2])
+    println(h)
+    @match direction begin
+            "R" => (h["j"] += steps)
+            "L" => (h["j"] -= steps)
+            "D" => (h["i"] += steps)
+            "U" => (h["i"] -= steps)
+    end
+    maxH = maximum([h["j"], maxH])
+    maxV = maximum([h["i"], maxV])
+    minH = minimum([h["j"], minH])
+    minV = minimum([h["i"], minV])
+end
+
+i, j = (23, 296)
+for line in input
+    @match direction begin
+        "R" => (h["j"] += steps)
+        "L" => (h["j"] -= steps)
+        "D" => (h["i"] += steps)
+        "U" => (h["i"] -= steps)
+    end
+end
+

+ 193 - 0
aoc2023/.gitignore

@@ -0,0 +1,193 @@
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+share/python-wheels/
+*.egg-info/
+.installed.cfg
+*.egg
+MANIFEST
+
+# PyInstaller
+#  Usually these files are written by a python script from a template
+#  before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.nox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*.cover
+*.py,cover
+.hypothesis/
+.pytest_cache/
+cover/
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+local_settings.py
+db.sqlite3
+db.sqlite3-journal
+
+# Flask stuff:
+instance/
+.webassets-cache
+
+# Scrapy stuff:
+.scrapy
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+.pybuilder/
+target/
+
+# Jupyter Notebook
+.ipynb_checkpoints
+
+# IPython
+profile_default/
+ipython_config.py
+
+# pyenv
+#   For a library or package, you might want to ignore these files since the code is
+#   intended to run in multiple environments; otherwise, check them in:
+# .python-version
+
+# pipenv
+#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
+#   However, in case of collaboration, if having platform-specific dependencies or dependencies
+#   having no cross-platform support, pipenv may install dependencies that don't work, or not
+#   install all needed dependencies.
+#Pipfile.lock
+
+# poetry
+#   Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
+#   This is especially recommended for binary packages to ensure reproducibility, and is more
+#   commonly ignored for libraries.
+#   https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
+#poetry.lock
+
+# pdm
+#   Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
+#pdm.lock
+#   pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
+#   in version control.
+#   https://pdm.fming.dev/#use-with-ide
+.pdm.toml
+
+# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
+__pypackages__/
+
+# Celery stuff
+celerybeat-schedule
+celerybeat.pid
+
+# SageMath parsed files
+*.sage.py
+
+# Environments
+.env
+.venv
+env/
+venv/
+ENV/
+env.bak/
+venv.bak/
+
+# Spyder project settings
+.spyderproject
+.spyproject
+
+# Rope project settings
+.ropeproject
+
+# mkdocs documentation
+/site
+
+# mypy
+.mypy_cache/
+.dmypy.json
+dmypy.json
+
+# Pyre type checker
+.pyre/
+
+# pytype static type analyzer
+.pytype/
+
+# Cython debug symbols
+cython_debug/
+
+# PyCharm
+#  JetBrains specific template is maintained in a separate JetBrains.gitignore that can
+#  be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
+#  and can be added to the global gitignore or merged into this file.  For a more nuclear
+#  option (not recommended) you can uncomment the following to ignore the entire idea folder.
+#.idea/
+
+# General
+.DS_Store
+.AppleDouble
+.LSOverride
+
+# Icon must end with two \r
+Icon
+
+
+# Thumbnails
+._*
+
+# Files that might appear in the root of a volume
+.DocumentRevisions-V100
+.fseventsd
+.Spotlight-V100
+.TemporaryItems
+.Trashes
+.VolumeIcon.icns
+.com.apple.timemachine.donotpresent
+
+# Directories potentially created on remote AFP share
+.AppleDB
+.AppleDesktop
+Network Trash Folder
+Temporary Items
+.apdisk
+
+
+*.ipynb
+
+

+ 94 - 0
aoc2023/aocutils.py

@@ -0,0 +1,94 @@
+import os
+import requests
+import time
+import bs4
+import markdownify as md
+
+YEAR = "2023"
+session_id = "53616c7465645f5f5203cbb171a7f6f4657fe17cc46d48121430546fb8dd3d7f7ea47108f02dc2d3631893eb094a4149bcbbe5a57215015a6bc953bfc808bd31"
+
+
+def create_files(task_dir: str, day: int):
+    ol_path = os.path.join(task_dir, f"day{day}.ol")
+    python_path = os.path.join(task_dir, f"day{day}.py")
+    if os.path.exists(ol_path):
+        os.utime(ol_path, None)
+    else:
+        open(ol_path, "a").close()
+    if os.path.exists(python_path):
+        os.utime(python_path, None)
+    else:
+        open(python_path, "a").close()
+
+
+def generate_readme(task_dir: str, day: int):
+    os.makedirs(task_dir, exist_ok=True)
+    readme_path = os.path.join(task_dir, "README.md")
+    cookies_dict = {"session": session_id}
+
+    soup = bs4.BeautifulSoup(
+        requests.get(
+            f"https://adventofcode.com/{YEAR}/day/{day}", cookies=cookies_dict
+        ).content,
+        features="html.parser",
+    )
+    with open(readme_path, "w") as readme:
+        readme.write(md.markdownify(str(soup.find_all("article")[0])))
+    if len(soup.find_all("article")) > 1:
+        with open(readme_path, "a") as readme:
+            readme.write(md.markdownify(str(soup.find_all("article")[1])))
+
+
+def get_input(task_dir: str, day: int) -> tuple[list[str], list[str]] | None:
+    input_path = os.path.join(task_dir, "input.txt")
+    example_path = os.path.join(task_dir, "example.txt")
+    readme_path = os.path.join(task_dir, "README.md")
+
+    cookies_dict = {"session": session_id}
+
+    os.makedirs(task_dir, exist_ok=True)
+
+    if os.path.exists(input_path):
+        with open(input_path, "r") as f:
+            input = f.read().splitlines()
+    else:
+        input = requests.get(
+            f"https://adventofcode.com/{YEAR}/day/{day}/input", cookies=cookies_dict
+        ).text
+        with open(input_path, "w") as f:
+            f.write(input.strip())
+        input = input.splitlines()
+
+    if os.path.exists(example_path):
+        with open(example_path, "r") as e:
+            example = e.read().splitlines()
+    elif os.path.exists(readme_path):
+        with open(example_path, "w") as e:
+            with open(readme_path, "r") as r:
+                example = r.read().split("\n\n```\n")[1]
+            e.write(example)
+            example = example.splitlines()
+    else:
+        print("call `generate_readme()` first!")
+        return
+
+    return input, example
+
+
+def bench(part):
+    def wrapper(*args, **kwargs):
+        start = time.perf_counter()
+        value = part(*args, **kwargs)
+        print(f"\tevaluation time: {time.perf_counter() - start} s")
+        return value
+
+    return wrapper
+
+
+if __name__ == "__main__":
+    day = 3
+    root = os.path.dirname(__file__)
+    task_dir = os.path.join(root, f"day{day}")
+    generate_readme(task_dir, day)
+    get_input(task_dir, day)
+    create_files(task_dir, day)

+ 66 - 0
aoc2023/day1/README.md

@@ -0,0 +1,66 @@
+--- Day 1: Trebuchet?! ---
+--------------------------
+
+Something is wrong with global snow production, and you've been selected to take a look. The Elves have even given you a map; on it, they've used stars to mark the top fifty locations that are likely to be having problems.
+
+
+You've been doing this long enough to know that to restore snow operations, you need to check all *fifty stars* by December 25th.
+
+
+Collect stars by solving puzzles. Two puzzles will be made available on each day in the Advent calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants *one star*. Good luck!
+
+
+You try to ask why they can't just use a [weather machine](/2015/day/1) ("not powerful enough") and where they're even sending you ("the sky") and why your map looks mostly blank ("you sure ask a lot of questions") and hang on did you just say the sky ("of course, where do you think snow comes from") when you realize that the Elves are already loading you into a [trebuchet](https://en.wikipedia.org/wiki/Trebuchet) ("please hold still, we need to strap you in").
+
+
+As they're making the final adjustments, they discover that their calibration document (your puzzle input) has been *amended* by a very young Elf who was apparently just excited to show off her art skills. Consequently, the Elves are having trouble reading the values on the document.
+
+
+The newly-improved calibration document consists of lines of text; each line originally contained a specific *calibration value* that the Elves now need to recover. On each line, the calibration value can be found by combining the *first digit* and the *last digit* (in that order) to form a single *two-digit number*.
+
+
+For example:
+
+
+
+```
+1abc2
+pqr3stu8vwx
+a1b2c3d4e5f
+treb7uchet
+
+```
+
+In this example, the calibration values of these four lines are `12`, `38`, `15`, and `77`. Adding these together produces `*142*`.
+
+
+Consider your entire calibration document. *What is the sum of all of the calibration values?*
+
+
+--- Part Two ---
+----------------
+
+Your calculation isn't quite right. It looks like some of the digits are actually *spelled out with letters*: `one`, `two`, `three`, `four`, `five`, `six`, `seven`, `eight`, and `nine` *also* count as valid "digits".
+
+
+Equipped with this new information, you now need to find the real first and last digit on each line. For example:
+
+
+
+```
+two1nine
+eightwothree
+abcone2threexyz
+xtwone3four
+4nineeightseven2
+zoneight234
+7pqrstsixteen
+
+```
+
+In this example, the calibration values are `29`, `83`, `13`, `24`, `42`, `14`, and `76`. Adding these together produces `*281*`.
+
+
+*What is the sum of all of the calibration values?*
+
+

+ 0 - 0
aoc2023/day1/day1.ol


+ 69 - 0
aoc2023/day1/day1.py

@@ -0,0 +1,69 @@
+import re
+
+with open("aoc2023/day1/example.txt") as example:
+    example = example.readlines()
+
+with open("aoc2023/day1/input.txt") as input:
+    input = input.readlines()
+
+with open("aoc2023/day1/example2.txt") as example2:
+    example2 = example2.readlines()
+
+numbers = []
+for line in example:
+    number = ""
+    for char in line:
+        if char.isdigit():
+            number += char
+    number = number[0] + number[-1]
+    numbers.append(int(number))
+print(sum(numbers))
+
+numbers = []
+for line in input:
+    number = ""
+    for char in line:
+        if char.isdigit():
+            number += char
+    number = number[0] + number[-1]
+    numbers.append(int(number))
+print(sum(numbers))
+
+mapping = {
+    "one": "1",
+    "two": "2",
+    "three": "3",
+    "four": "4",
+    "five": "5",
+    "six": "6",
+    "seven": "7",
+    "eight": "8",
+    "nine": "9",
+}
+
+numbers = []
+for line in example2:
+    number = {}
+    for ind, char in enumerate(line):
+        if char.isdigit():
+            number[ind] = char
+    for k, v in mapping.items():
+        if k in line:
+            number[line.index(k)] = v[0]
+    number = sorted(number.items())
+    numbers.append(int(number[0][1] + number[-1][1]))
+print(sum(numbers))
+
+numbers = []
+for line in input:
+    number = {}
+    for ind, char in enumerate(line):
+        if char.isdigit():
+            number[ind] = char
+    for k, v in mapping.items():
+        if k in line:
+            for m in re.finditer(k, line):
+                number[m.start()] = v[0]
+    number = sorted(number.items())
+    numbers.append(int(number[0][1] + number[-1][1]))
+print(sum(numbers))

+ 4 - 0
aoc2023/day1/example.txt

@@ -0,0 +1,4 @@
+1abc2
+pqr3stu8vwx
+a1b2c3d4e5f
+treb7uchet

+ 7 - 0
aoc2023/day1/example2.txt

@@ -0,0 +1,7 @@
+two1nine
+eightwothree
+abcone2threexyz
+xtwone3four
+4nineeightseven2
+zoneight234
+7pqrstsixteen

+ 1000 - 0
aoc2023/day1/input.txt

@@ -0,0 +1,1000 @@
+51591twosix4dhsxvgghxq
+425nine
+llvmhjtr8nbbhrfone
+lpbjvpbtdfvtxtdvkpjs7qrvddkzmjtlqtg
+3sixnineseven
+rfmsqbkms7three
+33291six
+oneonevstpxxrjpnine7six
+75sevennine14mzqljsjfbb7two
+three6two9jckvk
+zprj8394threehczfkncntk
+mkqtlrzmzfsix2ccqsnnxtwo4sevenxp9
+tdszrfzspthree2ttzseven5seven
+two3fiveckrsjr
+four14three7
+4fdkcclmxmxsevenfiver
+5sjnnfivefourzxxfpfivenine7five
+77sixfive
+twofivecrkvmpcpvzddvzcmjhjlthree8fcrrninefive
+fivetwo562five
+2ninekvdbfnmjmd6ninentpktmgseven92
+2twonine
+5fivesprm4ndqzbqnjqx
+7jfq9
+1hgnkmx91
+2jcrmhfvntc3lqnine4five4
+zvqmpjrpninejhqrnineggghcrjfd3onefive
+11three64qjjhqdnonetwo
+rmvzjnbonetwo6
+eightfive698threenine9
+8eighttrfngsklrkfivefourninefourqhclfcp
+1z
+fivegfslvcvtvs4
+sfq1twosevendbjq2nine4rzmdpmgcx
+seven816one8jmcqqhfnthree
+twor4325rsl5
+four2vqhninexqqhlfhfouronejks1
+7hjmmxhdnine8
+1eight3hqgshtb147
+four6sixeightone
+twomvkjxbqxzhnnmjxstkgfhzzdsc1fivefivesix
+3slhhsfnkhhlxtvqfrhvdzzkvlzcnlxgd4ninechp
+meightseven8onegghfsfeight84
+kmxckzqdfeightsqfivefivetfg77
+dc8
+mktwonecvqsxhqrjfninethreethreedkllgfxrxrffzvdbqdj2c3
+8shsxjmqmb3kpvj485nd
+rbdlrxsmjvnkttnpfour6twoseven
+bkt1seven
+threehkjhm9
+threeeight8sevennine7nlx
+jmvj4ctqpccsixseven
+4fourmtwoxcsvlvlhctdpxns
+eight7three4729eightbslrgrhs
+26seven1
+7ffseven
+9rsgmlgcsevenxkmsd17three
+snzn6htcqxqj7bf
+ppr7six73znmtmgrzrp9
+61mj7dvddfseveneight
+threevfive3fourseven3
+xznsxcxsbggvctqqb82two
+five4none
+foursevenrl12threegpbvdsspkrfour
+9sevensixthreerftbxgthree
+6fph
+996three
+64pkndfphqrglbgcpseven
+72749twoeightcpqfzqcrns
+xnzzhvssixtrlfftrjr5two9threenine
+four8hzkkrpb71glpqsnkvcb
+sixsix1
+9lfdtwo4sevenjhv911
+chxjljdh8jztwo61three
+twothree11
+hft2dmntjgzg1
+rtfckbnqxfdldgttbltdr33kqhxhkeight4
+ninefourseven4nine5
+25fsmkbsevenpzhgdhnxnbsix3
+bd1frglljngg8one1
+34six
+96cpcmztffqdrfrfslfour4lpnbmrfm
+psxrlseven2zmkvrhckqcxdl91
+ninexkfjcjkjb8three4xeighttqsrgbmfdt
+2threesixeight1
+ggxzf3gkdvsqxggltxdhdbhm5
+sixtwo89six
+eightnine3
+threemdrhqpone6
+sncpmhtwozsfpcpxgq9three
+rtwone37three7xhzlckfclbltdkrgqbcrhpqzg
+68sixbgsz35
+kdeightwo69
+four7bfq3four
+sixone3fivedgmrrvjqrr7three7seven
+sixthree6
+onethree3onevdtlkrfour4
+eight4seven5cszgblfseven
+two8ddmjtg
+fivejnvrdmghnvrmrjeightnnxpv8
+2threezvklqkpml
+two76cdfrmfckbjc
+zqxpg42sixeightfour76
+3eightvqpxzsn2bnbkrfb49
+eight85five
+sixngs8xjseight4
+296pfsgnlpbmngzlrrldznmrj1mjgvtxkr
+six4bvrdgxh
+34eight56eightsixhphnbgscfb
+two4twosixthreeggfdzlbkxxqmtxtczdfj
+four4tqrjxxcrztwoeight
+one73zpfhjvjh2
+7eight35phcfcdzhhpzn49eight
+zqcmlcqfneightsixrpmmhcrssk6dclcpmhzqhrbcnkxjdfjvrf
+1threegkhpq7nfrksvm69nxpvgvthfzoneighttc
+gtjsevensixsixb9
+nine73nine
+cbhsddcmzmdv2bnnffour
+85hhqkqmv
+six2jfxfgpg9
+fiveeightskrn1
+khvcf3five8qj5
+sevenfive7ptb
+tscc9psz3gtnsnksn
+xzlh7zfivefivejgr
+one4nine8three3
+2kjkbbvftktkvpbp8gkcnrrkr6r
+565three718five
+twojjgcfz3fiveoneftvnldxdhr2
+13three
+phbvxsnnineksttklfljm85
+tvzpbgzhmbnine1eightbpjtkflllg
+7five3
+2623four
+nvfchhrbcone1nine
+mjv5vtmlmsfcfmt65five1
+7one2
+4six4
+dlbzctlxpjxxqk96pmdgdfblbfjnsxjmkoneqgeight
+seven4nzvxldvzvjpzlzxb4eightnine6
+2vzblzhrxnc8qtgvxxzgkeightblqfftjtnxrbpvlsgvd
+thfdzxfqcthqfcnrt2
+qxfpbbnfczfourh4twodjrhp
+4m2fivelklgfgr6three
+4tsbs74
+one6twomzfncms2lrgzgsspkjmcgqxp
+six5fourgzrhbvdnzzllh
+9seventwothree8sevenfive4two
+7eightdprzmjvsevenfourfiveeight
+twosjzhsb29lqzkjbtshp5
+8four6two
+bklkfctjb84one
+sevensevenfive7seven6
+vklhzsjz5fiveeight5
+fourmlthreecjspnchzrthree8tb
+7gsfvptnpcl2n82
+58mdllbtjkkzcmdgzbeightbzqmfour
+2vtlzkzlsfive92vbpnq
+jbcgqvr28ksbphtfourfourfksnxjhtb
+21ljfcmgtmdqfive
+threejhhstcxfive64sixeightthree
+7tqpqngnrmnnxt3pjbcqjmktvj
+fmqqc9twoone15four
+5six13dnkxtqrxrh
+8xxpnpfivethreeh5ktnpctlqrgtl
+9hgmlnzsbmbsbjbg9
+8mnlsqkpqp18jkftxzfcklsgkvjr4threergdbrrzbb
+eightglhhjsfl819lkzlxjvcshdtjhxvjs8
+gshmsmzfbcrhvnfnpppmmfmngcv2snrponeqgxvtx
+9sprkdkk3cpjzlzphfdbhczbpssix
+nine8954five
+oneonettsixckhgprszjckhx2
+seveneightgnhzhm9pkthree3three
+5mjkpk
+sevenfour832five
+fivellhglxm2twoneq
+fqtfqdgeight2lfklmhrnfive
+flqdfkmlfthdvzncvbfour7gq
+793
+fourninetwojrfp4three5three5
+snnnjlhcnine84eightjthbkgtslhp4skglpzhz
+mnxfgpg862ninefive26
+bmdtbfjonegprzlxqlkb4mcscbqnv
+nine9fourfourfive1fivethree2
+eightfqrqz8
+fourpkd1bpxczlzthreecptvjlgzfmtqnr
+25onejrksrlccgrqtkcsmzccnine
+5nine26three88
+25four299fourfour
+hlrbll8vnhjlfjrkd
+ffourthreefourkgjbsnbc6
+eight8mpqpsgxthreegmxrhqkqbhgstcz
+three82five1
+4dxvzg29fourdsh
+ffgdlggchpcq7four34lfive
+seveneight9eightnpjmh9eightfive
+bnjrnsdfjg6
+76five
+five4nine6six
+q339eightkhnjsixttvqzlbchleight
+koneightonenine2nftlzxnkbctmjvzk98
+511
+4cghqsix3bqr
+958three
+seven2vmrkjqgrlb5
+9three6one5jdrnlfour6nine
+four2xdrqqsktone
+1sevendxkhzglzxgcmonesixrplhlplhnone
+6threefourhshvnszlqrzb
+7hctfsqf2jzjkxbljg
+sevencxncnc68
+49lfdkv2zbhddmbfive
+sevenfdsmsmmgzv29two6rpxsgpdsjxljcthree
+hgfqhdfb4mninesevenzngfljcvpvvkmghqxoneseven
+gtlqcggrp6lzjfive3rtrqvszcrsevennine
+qvhztzsfddxbbxsr88
+nine5kfnninelknrbf5bjrrthv
+pfnmdzksjcjcbvlvgcbheight47
+sixfour8
+cdbxkcqseven1
+onefive65mdbrnlg
+vlcxxcxhfkjhm6two5
+bfpnhlzq3tgcmhd4
+6three69eightgmxsseven
+three1six
+fourgqqgvltwofkxzmcfdmz4
+24four68nxs84spjnpfsdv
+m1threesvlhmgsbn
+three7jcvclg84sixfjvvtkfk7
+hznlsixjqnlvpmninejrvfpplbm5
+mgfrn6
+xb9469
+48713fivefour6
+sevenfiverzlhdzr59lbtvltccgbstzxksb
+rxkppsh771
+dldhcgdvtwosix3
+one4phkrftwo
+rrdrpfddtphv88jldqht
+vgcpcmrj6
+9zdqnzlthreelxzmlhsgdc1pddz
+669onesix
+5eighthlbhzlpms7qvbftcrone
+8mttfjqjnsf528hzvljcx
+eight9tseven25csfeight1
+7threethreetcdxnhnnftwosevennine
+54tsrjthq831sixcmxzqg
+61eight9kb5
+qlxmg4zhcpfxvrhlgjlcbxvxsix
+95two
+four75eight
+6fbrnsflmxstwo
+25
+eightcdl979gxzv97eightwogdv
+eightgbx85sevenseven
+3rfvzeightsjcctzxvtcrsix
+fivevqgm14
+dbfkfnfbckncvseven83drnkzt1
+11ninesevenxlxfr
+4ptvstqt7fivebznine
+5qmcnfour9
+four5mndpqsmxninethree56ctnlcpbtzmthree
+four2bqnbcbninemccbzhrfourbgrccrsznskjn
+rjdfqd24seveneightwom
+9ztmbftvvzlqlr4
+qprftkd3vkfhtwofour33five
+fourdtmjbtvvdxdhj5
+jpttch9
+9jkngffbxhg
+one79twoonesix
+2eight528nine2
+psncczvbeight3
+4seven7nlgrlzsqjsdb51
+five98lqc8
+nine377rcgvvhdghrg5scmff1
+8fvcxpr6kx5cpcrjdpnjcsj
+ltlbphmcc7six2
+4threek
+8hzmfhrnvt
+tbmzgpgkkxc89z4sqpd
+fivefourdjpdgfournine37eightzqbpgcnfrq
+sqh6llxn9z
+five1sixrqqclkhx334sixone
+289
+nqcspsixone822five
+bq19
+mxdqptgg99982vpthreesgdgsf
+vp334fourhdtjvlgtwo9seven
+3five157sixgzgxxfive2
+dvmtwone3sixfivetwo6ninezpjv
+9trtrdkldqj429hsrtd8
+6three3sxsbbhpgsix1
+3gccsixcghh
+six4nnbg
+ppvljnh5
+sevenmghppptnrtrzh7
+4sevenszkgbpldhklrtclm
+9qjsxmrmdm
+twoskbhlqhnkmgzkpvtft9five2qrkeight
+1v
+988fkxgkbonerglfsknxr5eight6
+xkdklvjbhv977lvlnmrj3gnfjrnttm
+1fourthreesevensevenxfdmtdone
+fourmg4xtvjbfmqkhtbslq1onehmtrtvsslrjdfncr
+twosgdlxsixfive1
+bscpkcfp8mhpvzn7threefqgcpfpmftsrmktwo
+sixeight4vthcxd48two
+1ninehclngfzbktvpjone
+one2sixmzxdqxvg4oneoneztbmplctc
+5tkhrmfrvonetwo
+lfgveightnqdmrv9six
+zzgmcr1jgzjjljhqmtnbrnbt
+one3vfour7eight
+fourseven3ninenine5four
+92kpdtggsb
+onecsfdhsn3gqmtfhc
+bhflvgdfkhprqqdgs6one
+1five93pmrhdvmgp7onesix
+56mgkt
+rksixfourfourthreefive3fdrbtgmdt2
+8one7
+rgvccbsrphxkmdgjkrjjztdzzmkgqbcdkseven69
+three4eightsixjgbnthfxvltwosevenxjkd
+5cffmxhdbtgtlffdb
+8fivetwoneb
+5trtgsgkvplfvqccknine
+two4gjjmptwo
+two845lltssr6
+six8xngnhbctl
+nhbxglqfjrhmhneightqmvlnqtwo53
+7nsr
+one2seven
+8eight2jphsz9
+9fivebv7kmxqtdvxq
+ninec4four
+vrtczjzbzg8bgf
+pvhnfhvsixbppv4oneshhqp8jprm
+tnxqmfive1khnmb
+onefivechd69nine8
+sxeightwoeightkpjxbkrvtbllbxfshseven4threemkbx7
+twofgcfp7ddjqvhrbvmkjdsltfps9bttz6
+sixninezpsbrvhvlz4
+four6sbtdldjcjrn7
+79drd742
+mmccvnldbhxcfnpxrftqc1sixlncsqs
+jjdpbsm2
+9fnhthreefourtftrmqhkmxrpnnhbxvk
+five168sixs4
+65fourkpzbhhgsghxvhlvlftfmck62
+8fivesixsvmzjhdmdqsixntzrckdk
+gfzjxptdqnineonepqqsldlvjrg5pdgthrslpfcfive
+38mmkcseven2four
+vghjzfchxsqq8fivefourone1
+tttjzcm3
+jpn764tsmrfvtjp7four
+onelhbhkmf7
+5ssfzvfrrvgleight71
+52lkxkxdjch5
+3eighttffhffht4
+832
+2gbhzrgchz
+threessdmstrhchfq73ftcfbrtrvf
+8xqs9scc
+xglmdxq24two28kcckrsqpzone
+16mkcl
+ldhmz3
+xzvttst5
+drkkc3
+8zhbplhvcr4
+one1xzbrkd59
+xzzbsnktjhjltsfrrrz3four
+8vlfgxgzsnfljbnnmlpz5nine3three
+99onehzdqm
+5zdtrvccn
+75sixsixkxldjnxslnvggnvvjbzcrqveight
+9sixztkk
+three9sevenone
+zxsgxfxpkpp45
+9hkshgthreekkvrplztccvb
+sixbvdxrhrc16
+1jbjbqhnqgg5shmgfm9seven99fvpnrrpks
+sixstsxgbmcx12qhhdr
+9trfxqzkdstwo2dzone5three
+one3drbrbtsevenonekmfdlffive
+nsnchfkxttwo2zgpbvkvktwofour
+cnzgzdvfm9
+8fst5jsgmxhbgklninebkkrs577
+xskvpkzcx2twoninebslrbdmqseven
+qlbpjqmptkseven9lqmcdvjcxqsix4
+eight7six2
+33h8rxmtlctrz67dz
+3rmkrn83seven4bxthree
+mmznine55
+1onefour
+two4fivenine
+fivesevenpp2onexcxjvllseight
+onehtfzdtjxskmzsbc4sixfourz
+mfkttfxqvtdqdrl93
+567
+qqpnrfninetwo55eight
+4qqmlrfbfrvpxvphjpbc
+nltblqfourbxxrrgvgkcbb5hzzgfour5dmdxl
+three2526ngfzssixsixseven
+1tffj2fcddnfxrzx34
+59jd
+sevenr8sevenvxltmxcssttwo9
+svklhbtwoxbbmk6ninekptrln7sixjqbjgxdhzr
+krbmcxpnxfrn4
+pnkfournjgpggxzjd97two
+cplfrzbgbleight2z7six
+ninep8xxxnine
+xqlrnzlz92ninehblgkztwonerc
+1nine7
+one8three361two98
+nine367qqslvgcxftwo
+3fournine3twofkcdmx6
+1b2ninethree
+6one4sevencnlsqzzmcxkxfnqjone9csmkx
+oneeightgh44eight66
+6x527threethreerggpfcfqlf
+eight1tnine7gjvtpvmqb1seven6
+six45six7fourmnhbskfthree4
+ltf4
+3hgqgdsmnsnine
+hjqneight5threeeight
+onekxbrlhkxgxbmbn6eightfourltspzkqdnone
+llfphldmghqrcnineeightonefive9vldfskjbhl1
+sixpjf5gjkdqkvvqhj
+2five685kvh17four
+pgslffcdvsix7oneightcs
+lznbhzonefivezgj45crzfl
+twosjggnvbxcmtwo8four5
+fourhtstxbkcz6fclrvgfrgbv
+nine4ninefourfdkdmjvlvzgsnjsfseven
+three318lmzcfive57
+5pmcnc
+861
+qbbhpjsg5r2
+jtxcphmrjnscfhqhk6seven2threefive
+qd1sixninefour
+four7fivethree65
+7dlzrddgrgfour3hxsttlnkbm29
+four4twonine8
+5zblkgmxninesevenbrhntxm
+xfvl9589
+five2seventhree6gbzb2
+cvmqqtskxlthree1
+sevenseventwo9xthreevzfdmfqvdf6
+six72sixeightnine9
+xrjnqqtlxz8bbgsqrseven6two9
+29seven153eightzl7
+sevengntsfmzkfb8
+1fiveseveneightdbvbtszptqlnineseventhree
+four6rks1v
+52eightninez
+5jspztgxrpt
+bq8jpttmm2
+fourctnlpkbrsfive9qd
+85twothreebbpsjcfh12oneeightwov
+xhxgfrcljq7six
+zh9
+9sixfiveseveneight
+rgqzbrldqrhtzjbsbzggktnc4nine8one1
+xcmfbrprxr72qqtnine
+tjphvghjfthree1one
+twosixeight9fourone
+eight48xronebc
+t6two34nkmfgmsnnvlbq3
+eighteightkx86
+82b6fcvvxpsx84
+threeeight66two
+six4pkbhtxlteighteightsix
+three7snrrdfb8sixninetwo4mltj
+5jqbgnqthreemjzgbvpdeighteight8tvf
+nine6zrbpsfrfqnsixlkmxrkxln
+2fivedvkt2998
+j2eightzqspbs
+mmp694eighteight
+3chzvrsrhzrcrtwoone2
+qqqzxcqmbb8nine
+sixsone7onesix1vvrqszvmnrh
+8threegtfnmkgthreesixthreeglhzqq
+threefiveone2three6seven4
+sixzkqbcg1
+two7seven85five
+cfhg3zmpfd644
+btsrthdbkt6242dhl
+hqlgnine5two
+2zgftzs8twovt
+mmpcgngmjjvbnsix35threezxjjxsqnlv
+lmmqsevenvjcvcqj55fiveninernmn9
+two7rgsbxnmddtjd
+36foursixsevencjffhxrsq
+4jxzfhxrphtgbjqfivefive
+99pqtnvtwo9crsbvsnrmtpltthree
+threedhk3hgvkp8nvbk6
+fivelkxdgvsq6twofive9hzjkdz
+ps7two9pqnnnvqpdbcpttjgrjl
+jjcfkvqdcl4twothreetwosix
+47one525
+23three2
+eight9four7gddxxfxcm9gdmmnfvbxr1
+745
+gkblgnrzsblklpb5bc8ftrnineoneseven
+jghbzdlmqbjm5glsqfffvzksc
+eightsix1five
+nznrzbdsv4
+16vdxm2hlrgtvgtdrbsix
+txk26eightnrjxrrlvffour2
+threesevenddmrsghzsjk2bdcqx
+eightthree9blrfjvrpfnjcfqrxcnine1
+two7three81htcdvdnxg
+seven1three6
+kplnzdjmkcrthreefour38
+bvf1sevenmcdfnv9lpnnh
+6eightqcznninesix
+two3sevensnpf6v
+eightthreeeight4986
+9seven7nine6nineseven6
+3two91
+six97three26hlxczxp
+65twopggttdksmtsblfpjbcphzc8eightwopx
+mbxtfmkfourrkspbkvbrnljsjhzpqsgtvrr2
+sixseven9one5
+three7twob98
+6c
+5797xjtwo83
+chrbcms6vpmrpctssbvqmvreight76
+mthgpstgchone6two
+597
+1799gjjdgzhg9eight
+vzqkgj27zpvxltzvrfcl47
+381lmxkxrfhbxqeight89tdhpbpqnx
+sevennine4
+29ninetwo1tvhpr6three
+dlbqfsdmdxhszmcpzshdthree3hvc2csbtfthree
+19khmsnhone
+twofourbtlsl1
+3sevenssevenfivefour
+8seventhreesevenseven
+three27rseven
+1jbdtfcdvvbzhgfsixrzqxkfktjmhkhfive5
+onetnznrrcthreefmmfivesbsvg4twothreetwoneqq
+sbjfxeight2tzbdkvqmmdd2
+vc4xfsjmt
+bfive9dmqgfnzvtngkbvthlrfjmsjtclbzbszfour
+31nbzfqvckd
+26kcdkzbjnpkpljxhgnhjgmtbrvkntjbqtwo
+3eightthree
+eighteight88
+five6bsix3rkchjzlfour94
+one9rrrbx3eightone
+6fourkxpdmt852eight
+8xhfbqqklnfive2one
+4ninetwoone6
+seven5seven
+1vzprkvk
+mczkrcdx7rzvgdd6ktcnktpfkpp
+sixnine988one
+68shx
+jqfoneight4sevensevenhmcrqjlzhnl6vcsqgmgnnxqhvchx8
+1fourgqbjvjhzdppdq
+lcxjghp2
+sevenone8nlh5
+nine94krdvjv5seven3
+ninenineseven8threentgtlzfnrfbhxxzn8jt
+nine37
+hbzztninexrrktrlktwohr1765
+5sixjdvfxdxslhthreethree
+2eighteight
+dfnbf65
+4onenineqjnlpninekgk
+oneoneeight974
+4nqqm83ninezkmbcblh
+7tpjhbeight1
+fiveninefdcnfourvdjcnsshnine3fivefive
+344
+crnqzpztstxvcgjdmkp6
+hgcvbscglp63tpfive
+seven5fivesixcbtblmlsixgvfbqttzonedld
+43threep
+zshzcplxth4nine2zcgsbzdlxtzbxggnine
+cqtwoneone9ckhnzmzfsevenfour8j3
+fiveshs8ttpcsznh
+hdpqds3seventwokbzlhxpj
+joneight9
+hmxxnxhqfivefiveseventtgxqcxc3
+59sixoneonezjgbshzpfg
+1gqqz
+8two38fourjm7
+1fiveeight1four69
+88eightwoffg
+threenine3threegqvtvtxgninerdprd
+7sixthreesixsixmgzlqlbsslseven7
+threegmrbgmsfourfourbvmhzpctkd5rzx98
+five193146mmqmf
+41fourxone
+2jhgqrkmmgbthreeeighttxg
+5xxbgpmm3
+5twonineffsevenfivetwonine
+seven98
+one7532rcc
+8djrctpqvpcd
+eightqqnhfnn2pjsevensixx7nine
+jkzjrbhsevenseven1
+4tnkqxkl69nrktzz
+six88five9nplcm
+xngrktpqclsmkqggj935oneeight
+8fourgbns
+eight47nine1two147
+vpshrqvfkjctpmhcfc22eightmqdxlsngbfn
+rfive1kxfbcpq
+twompnqfvqxqninevgvhqlpfqc15seven5eight
+9fournine4ntvhbkbhqn48mqhqhltbjpzrrgb
+ninesix2four937
+6cxpmgqnchk33mfdxfqdhxbfiveonethree
+9mqmldz3kjnsgfoureight
+4dmxtdvqvrvdrbfour5q
+8eightmcsbfive11four2thqxmbktdl
+zddeightwosixlmhrzfksevensevenfive3seven7four
+lvgfftzceightsevensevennineseven5twobkd
+nine7three
+zlmfvjfrxrrdmtxg965msd4
+two9five4sevennmrvdgzrf1bjdzbtrdlb1
+tjbnzrpzrflpfsrprsg9
+fourzcqfonesix279
+75fxlvc
+ldvmnfqpll7fourqxzpfctfxp1nhrhpvkbtmone
+seven4ninebpbdfjsxxmbqvtwo6one8
+fivefive47seven
+rxeightwomgzhcbnlmj72
+eight34xhbcmeightfour3
+nxszsbltqhthree4
+7threefiveninecqzfdjpdcg
+kdfour2
+ktworhdsfhhfqcrbzdslthmt2
+dpjbqmd7689
+threesix8
+61113threenine
+ninenine77fhtvsmfh23onefour
+bccdxg5three
+2eight1bnrx
+eight7sixdvvrqgt46874
+35onekpnthreeprznkpfvlneightwom
+52five6
+one3foursjnngjznqkfqklhjn
+eighttwomzrxzfqgtdthree3scbjdnq
+9fivecjgdnkxrt
+5nine442fb8
+nine6one
+241fouronenrlb6
+97sstjznxfcpccngfl7cxmzzcvptfive
+gvtsxbqzcone52
+5845836fourfgrvrchv
+7247zxfkqhvd
+fourxtwonine2eightfive
+znjxhfour229three
+fiveone8qjfmjbnnc
+1sqdjlfiveh
+fivegxfj9pfbxf5
+cnxmvmcrm4cfivedcnrnneightwosd
+four3oneone
+hbtfjlnplcsrxkt6rcqpfdseveneightwoh
+jqknine9xfour43sevenbgznxhh
+pvtztgjv47
+one9oneeight
+3npsq
+ninekmzdninejk7
+6threeninefhcpbb
+266
+pvtwocthreeeight1
+lpmshscqztgsgsb2zfcddqnvkseven
+dmoneighteight78oneeight9zqszseven
+eight8eight
+fcdlflbtfiverxfx9
+five7six5
+hhvmsspr4four8hhcjdhnthree
+three8qfzjpdztwodrkg5cg
+919lhzrx1
+foursevenfourfive6lvfour57
+crzmt7
+two71pzxnxtjkngfzm
+sixbmzlvcnine9
+hfbeightwo3eightfoursixfive
+j5twotwo57nine
+rmqq3sbjqnqmdjhmbp91hp
+3threezr
+fivesixfour81jqxx
+2bfeight7nine7
+fourfiveqjfkzsdxmgjmpmtone3hbgcvq
+7nrshoneninetwocpphnrfprz2five
+twoseven1bqjgdz2
+one7qonevmvb4sixhsbqgp
+fivethreethreegmdh1
+lv7d89
+2tbrnmflxfhhsixddn
+6sevennlhxsevensixt
+pd2kkfvtjbbgvfrcts
+djfoursevenflp2three6
+bppkvmxcrvffssdxgrr6mtlthree9six
+4szvlsixsevenxttwo
+ppggtqx8
+two3three6five
+threegplsmsjzjfcctwo6tkrkzmnk
+srtj2tsnxthreeonethreep
+szhnzblxslqthreejveightfvrrhbcqjqmmvczh1
+five2five25
+btvlzjhrxxdqdmbbcrmbffpmlmr9four
+1jdrpjpvkmmseven
+85bbbht
+2onel2p
+hdsfftwotpqcgdbdjbgnvfone3eight
+fourdgtccrxdnvfszgkjsj38
+twonine6twotvqxpskhonejsnpmtpctjfive6
+29eightcgskgdnmnhkpp63seventwo
+2seventwofhktwo9
+8kx
+32zxdzvfzjvtwofive9sevenfive
+2seven8pmdnnthreehnvltl7
+33sevenfournvnjp24
+two3m9kcsppfour
+hjfb9six5gtbppmzlfmfourtwodqzppcldd2
+4qlkz3
+4ninejzgpnkvq
+fbcpkspbcgrn6dmclmnqldeight
+sixtwodphp833
+sevenonesix5eightsrzpjzpj45rczn
+9fiveltfqjmkzbrm8oneightbq
+mxfqsrs5fpeightfive7mvclrlqhhkptpbqq
+438rktthreegvhltmsv
+dcl9xnntwosixthreesix7
+csxhsvkkkhfour4slkvjk1eight89
+three2eightfiveone
+17kqnstzmbthree9seventpld35
+ztxjhftwo1f
+ccfvc3three9five
+fmngmbkjppkxjnzqbqldmspbrrrhhrkrsix4
+9fivejthreepjtmtfive455
+4ncdvqfiveonefive5zxgjpptbnbsmbrfdpqrjnx
+ljctvztrxncpxsdtttwo2tnkkt
+five544mlzkztsblt17fivesix
+9five35bkbpjc
+6fourtwo
+nine5hqlbjp1onenvvnvsseven
+5qbvsbxtktqhgqxfgprsgsrrpdtpcmr8
+hhsgjxlz3gzxhz14fourtwofq
+6three8rmtrbnhvr
+9bhxvmhldnm6
+vkjjpkgdmxrzzfour7
+rhvrsrthsevenfour3eight5one73
+msqdzmfzfeight6qhrvzcdxfourrleight84
+pjtfflgfhqnpdk6three63five9six
+1sixcpcvbnnine9eightonenlnjfdfdmxcmcb
+zpgrbsevenmqskhgtrm6
+8hnqmmgrnsxhrxjjc2qjbbvpknh82
+5six7threepx
+bmlxvnqrxtqzkdlnnine5two9bpphfdhqj
+mtxrblghxrsbxhmgnbvgvffivenine49ztktxvfvseven
+tnqclrllq9fivebddnv
+56seven222pkmqk
+74eight9pfqghssgk
+nhmzdpbnlreightqgljp6
+nf3three2
+eight9glknfltsqsfdsixfour2tcfnzfmf
+four1ninetwo4sckcbgzrx663
+eightbcfsevennqznfmfivetwo7qgdjtwo
+64three
+8vgggxllsrhqjh2
+7jhthmpmlxlptgbnscxcthreeeighttwo3seven
+ktqlfveight1eightjnfxvvjk
+99qjcxgnpdvnbjqprbqnsjone3ninenmxkslmdsx
+9gn2
+qtlztwo7eight2
+nvzhsjsdp4sgrbmx36
+fldvmnlkq52nqtsccgfgtwolm7mmb
+tzvgkfx6ssnxfeightwov
+rrl8pxjj6onefour
+3hzhqbrdspfrn2eight8
+jcrcxtqh8three4
+ttwone449cxvvljcpzpqmngtzslnq
+3gnkgbjnsmxv2fourd8
+9zt
+kckeightsix8oneeightsix36
+vjcg4p
+jkzr3
+twofiveone1four9seven5cnhzm
+6one6
+s2twosixfvgrglfive2mtkrxznllj1
+cnhbzthlzllgghkxjgtrph45
+six5two
+nine5threefournine
+1rkbvrk8threevfkdbvxgj
+28six7dvone8
+74seven
+6threeseven92rvpg1
+hxvthvgk8vhn6kmljfnl
+fourztpprfkonemnjbsfdjlj8
+djnhxfxxl1five2threezgthn7
+vmhmlgljrpsix93sssixsevensix
+dqk8nrsrk
+jjtdjkfivegpfspqqjthreedkntgjslqreight7n8
+8four12
+8vlcfsixthreelvvdv
+zsjqvmghp6seventwo
+6tnjfl2cfzcbgqp5
+vgjxleightzqfklqdx4vlpvp2gqxdxpzk4
+12mshtkbgsndrdx7three
+htckznt2threeninej4fhmrtthreeeight
+four8hdbrmptjnine
+2xbk
+ljgcscxxjgdbpdpzfcchrqnmqqthree8
+three7six51
+four5five92ftqhjhx
+eightfthreebzbhk4tceight
+2fivethreefiveeight9fbk
+9four613two8cnpzgcrnmc3
+fqfive38
+nine88mkthree99lkvzgvpjk7
+784dxxcpszbzkdlsrgnnqfsixone7twonemvh
+onetwo5tzggnsix2
+xsclx3twojhslqrnc32pxfqsjxctnb4
+zrdbcccznzlfgz8jfpgllczxtnpmp58one
+four21one925rntdr
+38six
+seven3nfttdgkjhklmdqbkv8threefour
+75kblsbqhonevsx
+fourztseven8twothtwo
+gmktvrd44twonine4pnbrkhhzpl8five
+nineslj1six8two
+one98mxnkrbv
+9zmfour
+8dkfmthstlqvs9r
+cjmcjjjvmceight9rslcctdslsxthreexsjbffnine
+5eight677
+4twothree
+cvqbrkmgthree4tbmzrhqtpx
+24twoone
+nphprsbcfhcfrggktgzgvrninesixdnchjd2
+9sevennmxzpjbhct
+sbchgzqgdk8twosix667
+hkjlpqgtmglv3eighttwo7two
+gflktjvlfivetbgmbsxzdpdxjdgkzvn851sixfour
+five2ffivefiveonekldfpcfjg
+mlnvqltfsixnxqxsgfpxrpsxmmlnzsnineeight5
+six1z
+sevenpvhgctkcvgtjstwoeightzgqlcgq1gxzj
+fivenine13rbbxfs1zpvrstlkceight
+6zmcggdqbfptwofourfphdbdg99four
+one65ninetljqcfive8
+six57fourthree4fzctnjzcdm
+181one
+3one315gftsbtnggrq
+gcdvnzbvv55onemgcftkmzrxf
+697cnzql8eightvdsngsglkfour
+fourfiveqjptdn6
+pq83six7fprdbzvmgrhkzmjmxgnkcr
+nineeightfivesix8
+fiveseven931xhtnvrtr9three
+seven9ninetkhldts
+6threehlzfbppqmhrtxnfoursix2cxn9
+mphgdnggjt3flmdz14ninejjskfivenine
+boneight7one19179
+npdjlhskrdmvsvhtldsthree5tpt
+6rvpnvdqqpkkfvgclctqcmpdfvftt68
+91four3twoones
+seven793
+8h2four6cdsevencsjvcgdlrj
+4bzxqvp74mmdvjfdvq4fivec
+31tlvlrb75
+nndfct5ninesix
+ncqsnf6six
+fiveonefour8
+sixtwo6zjhvhkoneeighttbfv
+three5dcpmcsnmfhtwo5
+eightnqqkpnine4ninegb
+lgnsrbbtkgtwo7eightthree
+rlpcrnscknpjpqm2qqpllrzk8p9
+tvpqncpmffpmv9nineninesixnjbhbhgdlf2
+lzrhjdkfhn1
+jgjfckbrpvc3fouronefourfive3eight
+twozhkpzcdkjfour8eight
+5sevenfourtwo4
+1sevenfivehvppxvxvcnsnhdrflonefour
+4pshnstwo46fivetwoone
+three1onemdlc8pcqkzsrnhqone
+qvgfvfxnrp5bqdrlqd
+jzgcnslrfxxc72bqqqrzltqm18four
+nmjlnxktmvzzrgkbrffourdddbbt7eight
+3two9twothreerlztqftcgkznfour
+8fivefive5tkv
+4vtsnlclbb37eight2xprhpnddzj9
+8hbmfjxmqckxqrdjqxrnhg
+onef6
+8fivezcjtworgbxrfkjkbk5mdkdgfbnkkkljlv
+5six6prgqhbvcrr1msjcct
+mvzdrmdlrsdz9nqmbkb6286
+367
+94vjktbt
+twofivefour7three454
+2n
+six224
+z841dzxcthdx
+fourvnlj7twocchdcn976four
+threexmxq5five
+dscbqrjqmssnzbbdtx34
+8sevenhrvzqskpczsfhzrhrfch
+4qx
+6eightnine
+cnbxjrbsseven8hbdfmjvk6sevendrglnfq3six
+82threengstmq
+19f
+cvjrhrnxnfiveksrjgh8
+2six1dlpdds
+5xzhhnqpnsix8qthckdhggfdfour7
+9threetwoqznvtb4
+one8dseven
+3fivefourjzbk4seven8tvqgvh
+9kffjzvfxtwofive3seventhree5
+5onerxdcrrlgvfbrvrphnine5eight
+614pnrbdp
+eightfour1cvxjbztxgzznlpr8qbzkz35
+four5seventwo3
+9fourzzjfdqdkmxbeight41eightwopr
+eight6rfdhz793twonevkf
+vmrkgjgthreethree8ninesevend6hmjmkfdqz
+vqstkklpj4j8
+72jglrpp57nine7vcr
+sevenfbbgpxlvk7tmlvtjsixdtrnseven3d
+5jlb4
+jhkslf976fpseven
+jpfive1
+two2jpfztkeightssfsevennine56
+seven6rjchpgvmqgrxdddq
+four7eight
+zqoneight9mqmjtjcb
+ljcmvjf1ngrgzmttttqprks2kphjtgqvmeightvfmzqhdhgj
+77ninejjxxgbffive6zzgd
+4pthree5zp3one
+mhdzcmmsseven4three3bngxxqzclpkmcppxtwo
+bneightwo33ptmpcbfournine4five
+sevenfrzffbklg4dmdngxmsixnzjgpkngsfivetwo6
+six2onethreethree
+xhx4gvkbtcjbqvrhtwo6
+1mdfvninevchtrqthree
+onecrnninedjchhzkmzthree4qjnclshjlbn
+threeccgbz6sixlhnkcpfdzk119
+61dtwo
+ncsbdxnp43jlrxfhgzlrfzqjkzbkd
+nxfztwo9lhcc
+mds9vkninehzcdk
+twofive4jdcndg
+374
+threedrsh9eightcqkrslljl5tthree
+fourtwotwo8kl1bvplqfrc7
+threekldmmjkmc92sixsixonenine6
+bllccpcksq59zznr
+n35lxtnq3
+25hmzzxv
+38sevenkqgtfcpnj
+ntfceightmvhvnzjvv37bsj
+4sixfvrtgdsjvxsevenfouronefiveddns2
+eight29lnznht2oneonekgjkq
+4lthkrtj1onesevenninerfplsixfhxdvlhoneighth
+1seven8eightgxzvgmnqj
+7qfqvxcjttwoeighteightqqsgbsftseight
+slfqkljnine1oneeightlgskmlqgstwo
+sppqhlxqzkdtdqc6qtxsssdcf41
+tnggpjrnmrrgzpssptpk32
+6pcjglgdknjoneightssb
+ninefivefrglbccjmrchvbpsgxrq15fourfive
+7five1lmndzphnj4fouronesj
+jvhkb24htseven7
+7sevensjnrvxmsixthreesevengrh
+9h5xbdgpdjjkt1
+c14vbjvcv
+ninetwohfbm6fourjpgz676
+gqdtlzqvkplj48cxvtvjjlkmbstcfxd5hkbfdgtf
+ninelpxd8eightvmmbvgmhs3six1
+9mmlj4vvcxlnbsfoureight
+nzrjlxqhnffour1
+hl5fzsxdbvklx4five
+182ninedghflcgrqz4ns
+eightdmbqddsqmfive7qshcvdjx
+vdfzsevenoneone4ninemhclrkjspkxt
+2three1qzqhscbvmpnine86three
+1ninevvlzft
+1ghfnrvkn97sixqzgtm32
+sixnine4rsjghcsznfvs
+ph5mzknlknp5
+3eight3twotchnsqdtbkh
+63threerjlgv6three
+fivevvcmvrqfkdfshxjnfgsevensix3seven8
+21onebcsgvhtm6two
+bnjpqcqdzmeight2gtjhqeight
+1rsjbbhtkbbfourqzdhlone4eighttwo
+6jpnnlbstgjfjdrdgnthreepgh49hdxqghr
+five3oneonefrvnbnnlz
+gbseven9five6
+nine2hdltdjdp73phzrjnonegx
+3two3eightjszbfourkxbh5twonepr
+5cfprzgxtf3465five

+ 77 - 0
aoc2023/day2/README.md

@@ -0,0 +1,77 @@
+--- Day 2: Cube Conundrum ---
+-----------------------------
+
+You're launched high into the atmosphere! The apex of your trajectory just barely reaches the surface of a large island floating in the sky. You gently land in a fluffy pile of leaves. It's quite cold, but you don't see much snow. An Elf runs over to greet you.
+
+
+The Elf explains that you've arrived at *Snow Island* and apologizes for the lack of snow. He'll be happy to explain the situation, but it's a bit of a walk, so you have some time. They don't get many visitors up here; would you like to play a game in the meantime?
+
+
+As you walk, the Elf shows you a small bag and some cubes which are either red, green, or blue. Each time you play this game, he will hide a secret number of cubes of each color in the bag, and your goal is to figure out information about the number of cubes.
+
+
+To get information, once a bag has been loaded with cubes, the Elf will reach into the bag, grab a handful of random cubes, show them to you, and then put them back in the bag. He'll do this a few times per game.
+
+
+You play several games and record the information from each game (your puzzle input). Each game is listed with its ID number (like the `11` in `Game 11: ...`) followed by a semicolon-separated list of subsets of cubes that were revealed from the bag (like `3 red, 5 green, 4 blue`).
+
+
+For example, the record of a few games might look like this:
+
+
+
+```
+Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green
+Game 2: 1 blue, 2 green; 3 green, 4 blue, 1 red; 1 green, 1 blue
+Game 3: 8 green, 6 blue, 20 red; 5 blue, 4 red, 13 green; 5 green, 1 red
+Game 4: 1 green, 3 red, 6 blue; 3 green, 6 red; 3 green, 15 blue, 14 red
+Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green
+
+```
+
+In game 1, three sets of cubes are revealed from the bag (and then put back again). The first set is 3 blue cubes and 4 red cubes; the second set is 1 red cube, 2 green cubes, and 6 blue cubes; the third set is only 2 green cubes.
+
+
+The Elf would first like to know which games would have been possible if the bag contained *only 12 red cubes, 13 green cubes, and 14 blue cubes*?
+
+
+In the example above, games 1, 2, and 5 would have been *possible* if the bag had been loaded with that configuration. However, game 3 would have been *impossible* because at one point the Elf showed you 20 red cubes at once; similarly, game 4 would also have been *impossible* because the Elf showed you 15 blue cubes at once. If you add up the IDs of the games that would have been possible, you get `*8*`.
+
+
+Determine which games would have been possible if the bag had been loaded with only 12 red cubes, 13 green cubes, and 14 blue cubes. *What is the sum of the IDs of those games?*
+
+
+--- Part Two ---
+----------------
+
+The Elf says they've stopped producing snow because they aren't getting any *water*! He isn't sure why the water stopped; however, he can show you how to get to the water source to check it out for yourself. It's just up ahead!
+
+
+As you continue your walk, the Elf poses a second question: in each game you played, what is the *fewest number of cubes of each color* that could have been in the bag to make the game possible?
+
+
+Again consider the example games from earlier:
+
+
+
+```
+Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green
+Game 2: 1 blue, 2 green; 3 green, 4 blue, 1 red; 1 green, 1 blue
+Game 3: 8 green, 6 blue, 20 red; 5 blue, 4 red, 13 green; 5 green, 1 red
+Game 4: 1 green, 3 red, 6 blue; 3 green, 6 red; 3 green, 15 blue, 14 red
+Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green
+
+```
+
+* In game 1, the game could have been played with as few as 4 red, 2 green, and 6 blue cubes. If any color had even one fewer cube, the game would have been impossible.
+* Game 2 could have been played with a minimum of 1 red, 3 green, and 4 blue cubes.* * Game 3 must have been played with at least 20 red, 13 green, and 6 blue cubes.
+* Game 4 required at least 14 red, 3 green, and 15 blue cubes.
+* Game 5 needed no fewer than 6 red, 3 green, and 2 blue cubes in the bag.
+
+
+The *power* of a set of cubes is equal to the numbers of red, green, and blue cubes multiplied together. The power of the minimum set of cubes in game 1 is `48`. In games 2-5 it was `12`, `1560`, `630`, and `36`, respectively. Adding up these five powers produces the sum `*2286*`.
+
+
+For each game, find the minimum set of cubes that must have been present. *What is the sum of the power of these sets?*
+
+

+ 0 - 0
aoc2023/day2/day2.ol


+ 72 - 0
aoc2023/day2/day2.py

@@ -0,0 +1,72 @@
+import re
+from collections import defaultdict
+
+with open("aoc2023/day2/example.txt") as example:
+    example = example.readlines()
+    example_games = {}
+    for line in example:
+        cubes = defaultdict(list)
+        spline = line.split(": ")
+        id = spline[0].split(" ")[-1]
+        for tri in spline[1].split("; "):
+            for color in tri.split(", "):
+                color = color.split()
+                cubes[color[1]].append(int(color[0]))
+        example_games[int(id)] = cubes
+
+# examples[id] =
+
+with open("aoc2023/day2/input.txt") as input:
+    input = input.readlines()
+    input_games = {}
+    for line in input:
+        cubes = defaultdict(list)
+        spline = line.split(": ")
+        id = spline[0].split(" ")[-1]
+        for tri in spline[1].split("; "):
+            for color in tri.split(", "):
+                color = color.split()
+                cubes[color[1]].append(int(color[0]))
+        input_games[int(id)] = cubes
+
+with open("aoc2023/day1/example2.txt") as example2:
+    example2 = example2.readlines()
+
+mapping = {
+    "red": 12,
+    "green": 13,
+    "blue": 14,
+}
+
+not_valid = set()
+for id, game in example_games.items():
+    for color in game:
+        for num in game[color]:
+            if num > mapping[color]:
+                not_valid.add(id)
+print(sum((set(example_games) - not_valid)))
+
+not_valid = set()
+for id, game in input_games.items():
+    for color in game:
+        for num in game[color]:
+            if num > mapping[color]:
+                not_valid.add(id)
+# print(not_valid)
+print(sum((set(input_games) - not_valid)))
+
+sum = 0
+for id, game in example_games.items():
+    power = 1
+    for color in game:
+        power *= max(game[color])
+    sum += power
+print(sum)
+
+sum = 0
+for id, game in input_games.items():
+    power = 1
+    for color in game:
+        power *= max(game[color])
+    sum += power
+print(sum)

+ 5 - 0
aoc2023/day2/example.txt

@@ -0,0 +1,5 @@
+Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green
+Game 2: 1 blue, 2 green; 3 green, 4 blue, 1 red; 1 green, 1 blue
+Game 3: 8 green, 6 blue, 20 red; 5 blue, 4 red, 13 green; 5 green, 1 red
+Game 4: 1 green, 3 red, 6 blue; 3 green, 6 red; 3 green, 15 blue, 14 red
+Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green

+ 100 - 0
aoc2023/day2/input.txt

@@ -0,0 +1,100 @@
+Game 1: 10 red, 7 green, 3 blue; 5 blue, 3 red, 10 green; 4 blue, 14 green, 7 red; 1 red, 11 green; 6 blue, 17 green, 15 red; 18 green, 7 red, 5 blue
+Game 2: 13 green, 10 red; 11 green, 1 blue, 7 red; 5 red, 12 green, 1 blue; 12 green, 6 red; 8 green, 5 red; 12 green, 1 red
+Game 3: 7 green, 1 blue; 1 blue, 3 green, 1 red; 1 green, 1 blue; 2 green; 1 blue, 7 green, 2 red; 2 green
+Game 4: 7 green, 11 blue; 12 blue, 7 green; 1 green, 7 blue; 5 blue, 2 green; 5 red, 9 green, 14 blue
+Game 5: 2 red, 6 blue, 6 green; 2 red, 6 green; 12 blue, 5 red, 3 green; 12 green, 5 red, 8 blue; 10 blue, 5 green; 2 red, 4 green
+Game 6: 8 blue, 1 red, 17 green; 7 blue; 10 green, 6 blue; 5 blue, 1 red, 11 green
+Game 7: 1 blue, 2 red, 2 green; 1 blue, 3 green; 3 green, 1 red, 3 blue; 2 blue, 3 green, 1 red
+Game 8: 3 green, 10 red, 15 blue; 1 green, 9 red; 9 blue, 2 green, 12 red
+Game 9: 4 green, 10 blue, 13 red; 16 red, 7 blue; 14 red, 1 green, 1 blue; 14 red, 4 blue, 1 green
+Game 10: 6 blue, 9 red, 3 green; 9 green, 7 blue, 9 red; 2 red, 4 blue, 6 green; 12 green, 7 blue, 5 red
+Game 11: 1 green, 6 blue, 6 red; 7 red, 1 blue; 1 green, 6 blue; 4 red, 1 green, 1 blue; 6 red, 9 green, 4 blue; 5 green, 7 red, 4 blue
+Game 12: 18 green, 4 red, 12 blue; 7 green, 5 blue, 3 red; 7 green, 3 red; 8 green, 7 blue; 4 red, 7 green, 10 blue
+Game 13: 1 red, 2 blue; 1 red, 6 green; 5 blue, 2 red, 12 green; 1 red, 11 green, 2 blue; 2 red, 8 green, 1 blue; 3 blue, 16 green, 1 red
+Game 14: 3 blue, 2 green; 4 green, 1 red; 1 green, 1 red, 3 blue; 4 blue, 3 green; 5 blue, 1 green; 4 green, 2 blue, 1 red
+Game 15: 12 blue, 3 red; 5 blue, 2 red, 1 green; 12 blue, 3 red, 2 green; 1 green, 5 red, 6 blue; 1 green, 5 blue, 3 red
+Game 16: 8 red, 4 blue, 1 green; 15 blue, 5 red, 4 green; 3 green, 13 blue, 4 red; 4 red, 1 blue, 3 green; 1 green, 13 blue, 6 red
+Game 17: 8 red, 7 green, 2 blue; 6 green, 1 blue, 12 red; 3 red; 4 green, 1 red; 7 red, 1 blue, 9 green
+Game 18: 7 blue, 10 red, 3 green; 3 green, 1 blue; 7 red, 1 green, 7 blue; 7 blue, 4 red, 1 green; 2 green, 1 blue, 10 red; 3 blue, 11 red, 1 green
+Game 19: 10 red, 10 blue; 13 red; 4 blue, 15 red, 3 green; 6 green, 11 red, 11 blue; 4 blue, 8 red
+Game 20: 1 blue, 9 green, 2 red; 2 blue, 4 red, 4 green; 4 green, 2 red
+Game 21: 13 green, 1 red; 3 red, 5 green, 11 blue; 1 blue, 2 red, 4 green; 7 blue, 3 red; 2 red, 1 blue, 3 green
+Game 22: 2 red, 2 blue, 3 green; 10 red, 4 blue; 8 blue, 8 green, 11 red
+Game 23: 1 red, 2 blue; 1 blue, 1 green; 1 green; 3 red, 1 blue, 1 green
+Game 24: 12 green, 4 red, 2 blue; 8 green, 5 blue; 8 green, 2 blue, 2 red
+Game 25: 3 red, 8 green; 1 red, 4 blue, 1 green; 6 green; 3 blue, 5 green, 3 red; 9 green, 3 blue, 5 red
+Game 26: 1 green, 3 red, 2 blue; 7 red, 2 green, 11 blue; 7 blue, 4 red; 11 blue, 1 red, 1 green; 2 green, 10 blue, 1 red; 1 green, 7 red, 7 blue
+Game 27: 5 green, 2 red, 4 blue; 5 red, 4 blue, 3 green; 5 green, 2 red, 7 blue; 7 red, 15 green, 5 blue
+Game 28: 1 green, 7 blue, 14 red; 7 green, 6 blue, 3 red; 7 blue, 4 red, 10 green; 9 red, 11 green, 5 blue
+Game 29: 4 red, 6 blue, 5 green; 12 red, 3 green, 1 blue; 6 blue, 11 red, 6 green; 2 green, 2 blue, 12 red
+Game 30: 13 green, 11 red, 11 blue; 7 green, 9 blue, 7 red; 11 red, 1 blue, 11 green
+Game 31: 14 green, 1 blue, 8 red; 1 green, 2 blue; 1 green, 1 red, 1 blue
+Game 32: 7 blue, 2 green; 12 blue, 7 green; 4 red, 14 blue, 2 green; 14 green, 4 blue
+Game 33: 5 blue, 12 red; 3 blue, 4 red, 1 green; 9 red, 2 blue; 11 red
+Game 34: 1 blue; 3 blue; 1 blue, 1 red; 5 red, 2 blue; 4 red, 1 blue, 1 green
+Game 35: 3 green, 2 blue, 1 red; 2 red, 8 green, 3 blue; 7 green, 2 red, 8 blue; 3 blue, 4 green
+Game 36: 10 green, 9 blue, 2 red; 3 green, 7 blue, 7 red; 14 green, 13 blue; 8 green, 8 red, 2 blue
+Game 37: 3 red, 1 blue, 14 green; 1 blue, 1 green; 5 red, 9 green; 1 red, 2 blue, 13 green; 11 red, 14 green, 2 blue
+Game 38: 4 green, 3 red, 6 blue; 18 red, 15 blue, 1 green; 17 blue, 6 green, 19 red; 18 red, 15 blue; 1 green, 12 blue, 18 red
+Game 39: 1 red; 10 blue, 6 red, 1 green; 1 green, 1 red, 9 blue; 17 red, 10 blue
+Game 40: 5 red, 3 green, 9 blue; 8 red, 4 blue; 2 green, 3 blue, 4 red; 3 blue, 4 red, 6 green; 4 blue, 5 red, 2 green; 4 blue
+Game 41: 6 green, 1 blue; 5 blue, 3 green, 6 red; 10 red, 1 blue; 6 green, 1 blue, 9 red
+Game 42: 1 red, 5 green, 7 blue; 7 red, 4 blue, 4 green; 5 red, 2 green, 6 blue
+Game 43: 1 green, 18 red, 8 blue; 7 red, 4 green, 5 blue; 1 blue, 18 red; 5 red, 8 blue
+Game 44: 3 blue, 10 green; 5 green, 2 red, 1 blue; 6 blue, 14 green; 3 green, 5 blue, 5 red
+Game 45: 12 red, 1 blue, 16 green; 1 red, 6 blue, 3 green; 5 red, 5 blue, 7 green; 8 red, 15 green; 3 green, 12 red, 7 blue
+Game 46: 3 red, 1 green; 1 green, 17 blue, 10 red; 2 green, 17 blue; 3 green, 17 blue, 12 red; 2 green, 12 red
+Game 47: 3 green, 9 red; 3 red, 1 blue, 6 green; 10 red, 9 green, 1 blue; 2 blue, 15 green; 7 red, 12 green, 3 blue
+Game 48: 4 green, 13 red, 14 blue; 8 red, 8 green; 15 blue, 4 red, 11 green; 3 blue, 3 red, 4 green; 2 blue, 6 red, 4 green; 13 green, 12 blue, 11 red
+Game 49: 15 blue, 2 green, 7 red; 1 green, 7 red, 7 blue; 13 blue; 3 blue, 2 red, 1 green
+Game 50: 9 red; 5 green, 2 blue, 10 red; 5 red, 1 green
+Game 51: 3 green, 1 blue, 3 red; 4 blue, 4 red; 4 green, 6 red, 5 blue; 4 red, 7 blue
+Game 52: 10 green, 12 red, 2 blue; 2 green, 7 red; 18 green, 3 red, 3 blue; 6 red, 13 green, 2 blue
+Game 53: 13 blue, 2 green; 2 green, 12 blue; 1 green, 11 blue, 1 red; 11 blue, 2 green, 8 red
+Game 54: 5 red; 15 green, 17 red, 7 blue; 14 green, 5 red, 15 blue; 2 red, 10 blue, 16 green
+Game 55: 1 blue, 1 red, 2 green; 5 green, 3 blue, 8 red; 6 red, 4 blue, 7 green; 2 blue, 10 green, 7 red
+Game 56: 1 blue, 8 red, 7 green; 3 green, 7 blue, 5 red; 5 green, 7 blue; 3 blue, 12 red, 8 green; 3 blue; 2 blue, 3 green, 10 red
+Game 57: 5 red, 13 green, 3 blue; 19 green, 7 red, 8 blue; 1 red, 12 green, 3 blue; 4 green, 10 blue, 4 red; 3 blue, 7 red, 20 green
+Game 58: 8 blue, 5 red, 2 green; 4 red, 11 blue; 9 blue, 6 green, 8 red; 7 green, 11 blue
+Game 59: 7 red, 7 green, 9 blue; 5 red, 4 green, 5 blue; 1 red, 2 blue, 6 green; 10 green, 12 blue, 3 red; 7 green, 18 blue, 4 red
+Game 60: 12 blue, 7 red, 12 green; 18 green, 9 red; 13 green, 13 red, 12 blue; 14 red, 5 green, 13 blue; 17 green, 7 red, 13 blue
+Game 61: 5 blue; 2 blue, 10 green, 2 red; 12 green, 2 red, 1 blue; 4 blue, 2 green; 2 red, 6 green; 6 green, 2 blue, 2 red
+Game 62: 2 blue, 5 red, 4 green; 3 green, 6 blue, 7 red; 13 red, 5 blue, 1 green; 3 red, 3 blue, 1 green; 17 blue, 4 green, 3 red; 5 red, 13 blue, 3 green
+Game 63: 1 red, 6 blue, 10 green; 1 red, 8 blue, 6 green; 7 red, 11 blue
+Game 64: 11 blue, 13 red; 12 blue, 6 red; 1 green, 2 blue, 4 red
+Game 65: 1 green, 9 red, 4 blue; 11 blue, 3 green; 2 blue, 1 green; 3 red, 2 green, 10 blue
+Game 66: 8 red, 1 blue, 3 green; 1 green, 3 blue, 1 red; 2 blue, 9 green; 8 green, 3 blue, 6 red; 2 blue, 12 green, 7 red
+Game 67: 5 green, 5 red, 10 blue; 12 blue, 13 green, 4 red; 6 red, 11 green, 3 blue; 8 blue, 4 red; 4 red, 14 green; 1 red, 1 blue, 14 green
+Game 68: 7 green, 17 red; 14 green, 1 blue, 1 red; 11 green, 1 blue, 16 red
+Game 69: 11 red, 2 green, 2 blue; 4 blue, 14 red; 2 red, 6 blue, 3 green; 6 red, 2 green; 5 red, 1 green, 4 blue; 7 red, 3 blue
+Game 70: 18 blue, 4 red; 5 red, 14 blue; 17 blue, 9 red; 13 red, 17 blue, 1 green; 2 blue, 9 red
+Game 71: 1 green, 6 red, 6 blue; 6 green, 4 blue, 5 red; 8 red, 3 blue, 7 green; 7 red, 2 blue, 1 green; 3 blue, 2 green, 3 red
+Game 72: 11 green, 4 red, 2 blue; 2 blue, 6 green, 1 red; 3 red, 1 blue, 9 green; 4 blue, 12 green, 3 red; 2 red, 3 green, 1 blue
+Game 73: 1 blue, 12 red; 14 green, 2 blue, 10 red; 6 blue, 8 red, 8 green; 7 green; 6 red, 10 green, 4 blue; 4 green, 9 red
+Game 74: 5 green, 6 blue; 1 green, 12 blue; 2 blue, 2 green, 5 red; 5 green, 9 blue, 2 red
+Game 75: 11 red, 7 blue, 12 green; 7 blue, 8 red, 9 green; 3 red, 17 green, 3 blue
+Game 76: 1 green, 12 blue; 11 blue, 7 green, 10 red; 10 green, 12 blue, 1 red; 10 green, 12 red, 1 blue
+Game 77: 2 blue, 17 green, 3 red; 10 red, 13 green; 12 green, 2 blue, 13 red; 12 green, 2 blue, 8 red; 14 green, 10 red, 1 blue
+Game 78: 3 red, 8 green, 5 blue; 8 green, 3 blue; 2 green, 6 red; 4 red, 1 green, 4 blue; 4 red, 8 green, 6 blue; 1 red, 1 blue, 8 green
+Game 79: 1 green, 2 blue, 2 red; 1 blue, 19 red, 1 green; 18 red; 1 green, 3 red, 5 blue; 15 red, 1 blue; 2 blue, 17 red, 1 green
+Game 80: 13 red, 1 green; 15 red, 1 blue; 8 red, 1 green
+Game 81: 1 blue, 1 red, 2 green; 1 red, 3 green, 2 blue; 1 blue, 4 green; 2 green, 2 blue
+Game 82: 8 red, 4 green, 8 blue; 4 green, 6 red, 3 blue; 3 red, 3 blue; 2 blue, 1 green, 11 red; 2 green, 1 blue, 4 red
+Game 83: 1 red, 15 green; 2 red, 6 blue, 12 green; 3 green, 10 blue, 14 red; 6 blue, 7 red, 1 green
+Game 84: 2 blue, 12 red, 4 green; 1 red, 3 blue, 5 green; 6 blue, 5 green, 12 red; 2 red, 1 green; 2 red, 5 blue, 5 green
+Game 85: 4 red; 3 red, 15 green, 2 blue; 15 green, 1 red, 2 blue; 4 green, 4 red, 2 blue
+Game 86: 1 green, 3 red, 4 blue; 2 green, 7 red, 4 blue; 7 red, 4 green, 4 blue; 1 blue, 11 red, 4 green
+Game 87: 5 green, 5 red, 15 blue; 4 blue, 12 red, 10 green; 3 green, 11 blue, 9 red; 3 red, 4 green, 16 blue; 3 red, 10 blue, 10 green; 15 blue, 9 green, 12 red
+Game 88: 2 green, 10 blue; 4 blue, 8 green; 8 green, 1 blue; 13 blue, 1 red, 2 green; 2 green, 16 blue
+Game 89: 5 blue, 7 red; 10 red, 11 blue, 6 green; 6 green, 3 red, 7 blue; 5 green, 3 red, 20 blue; 8 red, 6 green, 10 blue; 7 blue, 5 green, 10 red
+Game 90: 4 red, 1 green, 4 blue; 9 red, 9 blue, 9 green; 4 green, 11 red; 9 red, 5 green, 3 blue; 9 red, 2 green, 2 blue
+Game 91: 13 green, 13 blue; 3 red, 11 green, 5 blue; 10 blue, 3 green, 1 red; 3 blue, 10 green, 2 red; 5 blue, 2 green
+Game 92: 8 blue, 1 green, 4 red; 3 blue, 6 red; 3 red, 1 green, 14 blue; 6 blue, 8 red; 15 blue, 9 red; 4 blue, 2 red
+Game 93: 3 blue, 17 red, 2 green; 9 blue, 6 red; 6 blue, 2 green, 16 red; 1 green, 5 blue, 15 red; 3 blue, 2 green, 14 red
+Game 94: 7 blue, 19 green, 1 red; 4 blue; 8 blue, 3 red, 4 green
+Game 95: 2 green, 6 red, 13 blue; 5 red, 12 green, 12 blue; 18 blue, 8 red, 4 green; 7 red, 6 green, 17 blue; 4 green, 9 red, 6 blue; 10 red, 1 green, 4 blue
+Game 96: 8 blue, 9 red; 9 red, 10 blue; 5 blue, 1 green, 2 red; 2 blue, 2 red
+Game 97: 4 red, 1 blue, 2 green; 2 green, 11 red, 1 blue; 8 red, 1 green; 7 red, 3 green, 1 blue; 5 red, 1 green, 1 blue
+Game 98: 6 green, 4 blue, 12 red; 3 blue, 13 red, 1 green; 2 blue, 12 green, 2 red; 13 green, 2 red, 1 blue; 10 red, 7 green, 1 blue
+Game 99: 6 blue, 3 green, 5 red; 3 green, 6 red, 8 blue; 3 green, 11 blue, 14 red; 14 red, 5 green, 1 blue
+Game 100: 16 red, 3 blue; 2 red, 5 green; 9 red; 1 blue, 3 green, 10 red; 1 red, 5 blue, 3 green; 12 blue, 9 red

+ 87 - 0
aoc2023/day3/README.md

@@ -0,0 +1,87 @@
+--- Day 3: Gear Ratios ---
+--------------------------
+
+You and the Elf eventually reach a [gondola lift](https://en.wikipedia.org/wiki/Gondola_lift) station; he says the gondola lift will take you up to the *water source*, but this is as far as he can bring you. You go inside.
+
+
+It doesn't take long to find the gondolas, but there seems to be a problem: they're not moving.
+
+
+"Aaah!"
+
+
+You turn around to see a slightly-greasy Elf with a wrench and a look of surprise. "Sorry, I wasn't expecting anyone! The gondola lift isn't working right now; it'll still be a while before I can fix it." You offer to help.
+
+
+The engineer explains that an engine part seems to be missing from the engine, but nobody can figure out which one. If you can *add up all the part numbers* in the engine schematic, it should be easy to work out which part is missing.
+
+
+The engine schematic (your puzzle input) consists of a visual representation of the engine. There are lots of numbers and symbols you don't really understand, but apparently *any number adjacent to a symbol*, even diagonally, is a "part number" and should be included in your sum. (Periods (`.`) do not count as a symbol.)
+
+
+Here is an example engine schematic:
+
+
+
+```
+467..114..
+...*......
+..35..633.
+......#...
+617*......
+.....+.58.
+..592.....
+......755.
+...$.*....
+.664.598..
+
+```
+
+In this schematic, two numbers are *not* part numbers because they are not adjacent to a symbol: `114` (top right) and `58` (middle right). Every other number is adjacent to a symbol and so *is* a part number; their sum is `*4361*`.
+
+
+Of course, the actual engine schematic is much larger. *What is the sum of all of the part numbers in the engine schematic?*
+
+
+--- Part Two ---
+----------------
+
+The engineer finds the missing part and installs it in the engine! As the engine springs to life, you jump in the closest gondola, finally ready to ascend to the water source.
+
+
+You don't seem to be going very fast, though. Maybe something is still wrong? Fortunately, the gondola has a phone labeled "help", so you pick it up and the engineer answers.
+
+
+Before you can explain the situation, she suggests that you look out the window. There stands the engineer, holding a phone in one hand and waving with the other. You're going so slowly that you haven't even left the station. You exit the gondola.
+
+
+The missing part wasn't the only issue - one of the gears in the engine is wrong. A *gear* is any `*` symbol that is adjacent to *exactly two part numbers*. Its *gear ratio* is the result of multiplying those two numbers together.
+
+
+This time, you need to find the gear ratio of every gear and add them all up so that the engineer can figure out which gear needs to be replaced.
+
+
+Consider the same engine schematic again:
+
+
+
+```
+467..114..
+...*......
+..35..633.
+......#...
+617*......
+.....+.58.
+..592.....
+......755.
+...$.*....
+.664.598..
+
+```
+
+In this schematic, there are *two* gears. The first is in the top left; it has part numbers `467` and `35`, so its gear ratio is `16345`. The second gear is in the lower right; its gear ratio is `451490`. (The `*` adjacent to `617` is *not* a gear because it is only adjacent to one part number.) Adding up all of the gear ratios produces `*467835*`.
+
+
+*What is the sum of all of the gear ratios in your engine schematic?*
+
+

+ 0 - 0
aoc2023/day3/day3.ol


+ 136 - 0
aoc2023/day3/day3.py

@@ -0,0 +1,136 @@
+import os
+import jax
+import jax.numpy as jnp
+
+with open(os.path.join(os.path.abspath(""), "day3", "example.txt")) as example:
+    example = example.readlines()
+with open(os.path.join(os.path.abspath(""), "day3", "input.txt")) as input:
+    input = input.readlines()
+
+
+def solve1(pop):
+    example = []
+    for ind, line in enumerate(pop):
+        line = "." + line.replace("\n", ".")
+        example.append(line)
+    example.insert(0, "." * len(example[0]))
+    example.append("." * len(example[0]))
+
+    part_numbers = []
+    numbers = []
+    adjacent = False
+    for i in range(len(example) - 1):
+        number = ""
+        for j in range(len(example[0]) - 1):
+            el = example[i][j]
+            if example[i][j].isdigit():
+                number += example[i][j]
+                if (
+                    example[i - 1][j - 1] != "."
+                    or example[i - 1][j] != "."
+                    or example[i - 1][j + 1] != "."
+                    or example[i + 1][j - 1] != "."
+                    or example[i + 1][j] != "."
+                    or example[i + 1][j + 1] != "."
+                    or not (example[i][j + 1] == "." or example[i][j + 1].isdigit())
+                    or not (example[i][j - 1] == "." or example[i][j - 1].isdigit())
+                ):
+                    adjacent = True
+            else:
+                if number != "" and not adjacent:
+                    numbers.append(int(number))
+                    adjacent = False
+                elif number and adjacent:
+                    part_numbers.append(int(number))
+                    adjacent = False
+                number = ""
+    # print(part_numbers)
+    print(sum(part_numbers))
+    return part_numbers
+
+
+solve1(example)
+a = solve1(input)
+
+def solve2(pop):
+    example = []
+    for ind, line in enumerate(pop):
+        line = "." + line.replace("\n", ".")
+        example.append(line)
+    example.insert(0, "." * len(example[0]))
+    example.append("." * len(example[0]))
+
+    part_numbers = []
+    numbers = []
+    gear = False
+    geared = {}
+    for i in range(len(example) - 1):
+        number = ""
+        for j in range(len(example[0]) - 1):
+            el = example[i][j]
+            if example[i][j].isdigit():
+                number += example[i][j]
+                if (
+                    example[i - 1][j - 1] == "*"
+                    or example[i - 1][j] == "*"
+                    or example[i - 1][j + 1] == "*"
+                    or example[i + 1][j - 1] == "*"
+                    or example[i + 1][j] == "*"
+                    or example[i + 1][j + 1] == "*"
+                    or not (example[i][j + 1] == "*" or example[i][j + 1].isdigit())
+                    or not (example[i][j - 1] == "*" or example[i][j - 1].isdigit())
+                ):
+                    gear = True
+            else:
+                if number != "" and not gear:
+                    numbers.append(int(number))
+                    gear = False
+                elif number and gear:
+                    part_numbers.append(int(number))
+                    gear = False
+                number = ""
+
+
+def solve_reddit(lines):
+    lines = [line.strip() for line in lines]
+    NUM_LINES = len(lines)
+    LINE_LEN = len(lines[0])
+
+    nums = []
+    for i in range(len(lines)):
+        j = 0
+        while j < LINE_LEN:
+            if lines[i][j].isdecimal():
+                start = j
+                num = ""
+                while j < LINE_LEN and lines[i][j].isdecimal():
+                    num += lines[i][j]
+                    j += 1
+                j -= 1
+                nums.append((int(num), (i, start, j)))
+
+            j += 1
+
+    sum = 0
+    pnums = []
+    for num in nums:
+        part_number = False
+        for i in range(num[1][0] - 1, num[1][0] + 2):
+            if i >= 0 and i < NUM_LINES:
+                for j in range(num[1][1] - 1, num[1][2] + 2):
+                    if j >= 0 and j < LINE_LEN:
+                        if not (lines[i][j].isdecimal() or lines[i][j] == "."):
+                            part_number = True
+                            sum += num[0]
+                            pnums.append(num[0])
+                            break
+                if part_number:
+                    break
+
+    print(sum)
+    return pnums
+
+
+b = solve_reddit(input)
+
+print([n for n in b if n not in a])

+ 10 - 0
aoc2023/day3/example.txt

@@ -0,0 +1,10 @@
+467..114..
+...*......
+..35..633.
+......#...
+617*......
+.....+.58.
+..592.....
+......755.
+...$.*....
+.664.598..

+ 140 - 0
aoc2023/day3/input.txt

@@ -0,0 +1,140 @@
+........936..672.........846.922........359...332......582..856........................579..93......674..740.....243.156....................
+...........%.........4=...*...*........*.......*......#....................806..481.........................*.......*.........900......$564.
+.............520........624.965....143..405.....960.............273...651...*....*.........554....139@.....38...*.........58..*...392.......
+................$....................*.........................*.....&......634.3..../.................-......310....*313.*.........*.......
+...196....544......541................775.216...+557..225/..463.......................517..........960.228........452.....593.......772.....
+.....*....*...654.*........638............*...........................163....................386#......................20......169..........
+.....566..20...$...132........*969......747........*971..342............=.245*.......................277.522............*..............+....
+.............+..............................205.716...........................855.............324......................871..752.........291.
+.........47..390.......128...%....528........%..........91*192.......=.....................=.#.............%..852*156......+................
+.....975..*.......=....*...322.......#............&63.............946...................462....939..520...268............#.....*....380.....
+.........55..=.....871..68.............................................491.......................*.....*............674.770.333.415...*.275.
+..............633...........@.....642.5........+.......739........632.....*.......992.74.615...858...998.............*..............761.*...
+....446......................180./..../........83...&.....*924....&........379...*......................................................118.
+...........488*240.......150......................958..........$.....&...........964...351...........+..633.........123....../603...........
+...................987....../........546-...674...............466.....602.............@...........956..#............./......................
+......503=....465.................91.........*..........................................583..............128..124..........$.....217........
+..............*...32$..53....&594.........648...827....*..994.......971...................*..........304...%....*.......387..80.............
+............756.......#..........................*..888...$............@....339.......+..868........*........851..............*.........128.
+...905-.........312..................729...356*.697.........736.....+.......+.......748.......797....41....................272..753.........
+.................*....&604............*.............%915.......*.529..889...................*.........................992.........*.....718.
+...........272....487..............+...961.892..............632........*.................502.118....141................@......546.669.......
+787..........*....................85............/..330...........-...374.............................*.........446...%.........*............
+....-...../...120....919&.....................339....*....*663...403........167...533.170.............698..587...*....279.......776.+.......
+.575.....34.*.................668...19..759.......804..730...../.............*...........*.....789...........*....803......666.......25.....
+............375...773*.............*.........................$.876...287......201........484......*.........196.............................
+565...866.............23..477...455....................794.996.........*.....................887.959...146...........496....790.............
+..............648...........+........325.738....156.....*.........534..941.....%536..31..../.%...........*............*.....*.......511.....
+..............*.................166.....*......*.....647..........*......................262...........887..210.3..860.....161....4....*420.
+......141.606...........193.111..*..........252......................935*689..................500...........*...*.................*.........
+..635....*........=........*.....959.....................@834.................-.....542..547....-..........770.8...........439..............
+.................896.........93......................244..........@......247..735..*.................................497.............%......
+...............................%........................*..........200....+.......342.613.245.@............$.........#....*.......176...21..
+......51......702.37.......798....325.....&974.....834.860.....+.........................*.....533..866....864.............269..............
+..141..*......................-...&............875*.............207...882*.........................*............309.739........%......../...
+.......394....144.....................................$...................835.3..........290.......489...........&.....*177.833....866$.153.
+.689.................719.314/..$......673.....5*557...443......+..#649.............575....*..634*...........................................
+....&...........794...*........614...*......................350.............411......*.104.......141........369...934...........997.........
+.......519......*...787..............739.....628...................................784.......$..........989*........*...987.......*....#....
+.........*...309.........209.............957*........50.....@995...765.......269.@........380..624.................643.....*....836...356...
+......886............234.+....................51*935..*...........*.....188.......73..............*696...14.....#...........................
+............203..948...&...............................957......804.736*......388....689.219*660........*.....218....................$..40..
+..............*.....*.....475.....930..........%................................*......*..............477.624................848...687......
+....57*.50.229....636....*.................804.164....590.........-....547..80..310....675.......=.@...........................*............
+........................398......&........*..............*.....748...........*................226..200................160......853..........
+......292........................889.......867.....365...............192+..530.........................@910....=..222*.............894......
+..427....#.../...959........................................322.....................735*304....742..........195..........$..............22..
+...........465..-.........52.$......168.......418.......+.........................................$..............&......563...649*26........
+....................464..../.969....*......-..*........150......724.....83..301...............527...............858.506.....................
+...935.........910....+...........116....427...347.............-........*.....=.......891.......*....847...750........@................531..
+....*.........$.........676...............................510............11.......647.*.................#.....%.683.............193...+.....
+....761.169...............=...524........&......152..........*...975.994.........*....122..........858*...........%.......776...........*...
+...........-..180/.850..............$.....524....-...........940.=......*......199........963..............#........836...*.....34...543.448
+482...947...................94&....541..............265..............477..890..............*....988.....343..........&...599....+...........
+.......*...532..81..73..417............992/...99&...#........................*.33@.149..305.........678.....31.........@.................417
+....304.....@.....*...#../....452.842.................519.....307.949.....268................=.........*....*...........259.................
+..................361............*.......346............*.+......*...........................288.......492..985.............727.683.........
+....530....438..........950..........*......*........787..316...............762.724.257..889.....................844.......*......=....@125.
+..............*...446...*......879..827......148......................*730.......@..........*...832...............*.......647.......48......
+....500.......994........41.......*.....#805...........*...........614...............*....940................291&.129.8............=........
+....*...#..........698..........581.................940.462.....@......443...82.784.593......../.#375..%148............*..#.................
+.....39.562...784............................................805...$......@...*..*..........844.....................776....363...667........
+................%...265.......337.....438...295.....................499......341.74..................271.405.......................%.155....
+.........97..........*......@....*252.*......*....+.........270.229.................394...879*247.....*...*.....146.....................*...
+........%.............226..258........996.944......793........*.../...................+..............321.578.....$..........838.....529.831.
+.................%109.........................................615....822.....................501.............616....293.....&........-......
+.......%....482...........................%717.236.......562...........*...........915...580....*............*.....+..........230...........
+.....303.......*128..86&......762.928.............$........*......861*.311........*....../....517..........471.544.....996.......*38...628..
+...........563............89.*......*.583...%.148.......$.987...................35..................996...........=....*...............*....
+......776.....+...........*......967...@..168...*.....772.........838*.....480..............................-........976..............530...
+................649*32...84.#...................315...................37............398.656...631..........340.985*..........522............
+............................922........................./.173....894................*.........$....................177.......#..............
+......................................................423....*....*.....816.........13.................=..............................251...
+..154...................878*......................568......723..329....&......928.................-71.123.378..100...................*......
+........*21..250............448.734.718.....&....*......................................599...............%....*.....700+.....*803..401.....
+.779.550........*.817............./..*....118....980..589.....235......=....539...........*...281*236..........591.........927..........*...
+...-.................*...............854.............*.................911.=............939........................616..*............770.50.
+.............82......399.......452..................184........643..........................*871..................*....370..................
+.185.405.....*...634............*......189.838.................*...............@623......252...........315.86.....568...........157.104.....
+...&......586.......*........957..........*.......841.........509.600........................896..565.....*...............+............*....
+..................633.628...........811..........*.....677.........-..580..751...183.........................540.81.......656..665..634.....
+......112.............*.....=........./.322...430.........*..........+.....*...............683............$.....*...........................
+830&...*..426........649..910...........*................717..359........831........=..157..%.............143......758................579...
+.....373....*..................215.......666....................*.#...........459..547...+.........773.........980*.........404...126.......
+205......636....................*...420.......440..........225.11.516...568....*......................*....474........620...*.....*.........
+..............250......685...209.....+...........*257.................../...407.......295..498....122.............970...@.392.412...........
+783..83+...........706....=.................330*............833.................*250....%..=..........%...........*............#....898.....
+...........$....................................398..35........*......646....759.....#.............527..........160.....254.................
+500........777...........112..428...663....957#..............524.....*..../........249..530*672............567......*......*759.....284*....
+....861....................*.*......*............*...277*832.....644.130..216.446............................*...683.955................950.
+....*........826..........68.535..192.........306..................#..................762%...%....#631..500.406..........763...137..........
+..65............-...499=..................546.....&.........$........../..........177........988.......@.............336...*..*.............
+.....362..................@...$..........-....610..65......64.........830..........-...........................452......+.604.542...........
+........*902.633*........873..63.....781...31...*.................258.....12...681..........18*........&...&............................848.
+..803............752.........................-.....672...................*.............................470..86.59.......%...................
+.......@..547..........$...184.......320..........+..........471......834...=...551..108.............................176.................82.
+..950.562............261...$.....754..+..............134.654*...............778..&......%..713.837.......................329........186.....
+............112..72...............*..........917......*.................415............................946....=....614.....*................
+..............*.$......850.....766.....308.....*....666................*......812.....293................*.624.......%..296.....612...333...
+..996......154...........................*......283.....*.555.%........................-.......552.714.563.......227..............-.........
+....*.682.................=.......281.217..............84.*....908.....@...=....522..............$.*.......630......*79..............556....
+..635...*............516...402............................333........114..496..*.......324..........522.....................................
+.........511....779...*............@............350.853.........................791...................................$.....821.....+.......
+.................*.....486........984......332.....*..............893..730*480...................756...................776...........155....
+......161......57..590....................@....398..................*....................477.....*......602....506............996...........
+.151.....*..=.......*......955.......916........#.....=..269.........423..........289......*..379...*..@.....................*..............
+...-....123..927.600...........-........*395........226./....676*755...........30..........58.....582.........671.118..43.367...943......478
+.....................725........74...............................................+...........................-......*..*................&...
+........378......563*.....*999............*...................497.349...26.....$............362.........&........723....20....717...317.....
+...*....................22.........../.575.552..........291......*..........600......152.../......./...169......................-.@....*977.
+886.250..........$.............383.603.............36*.../....%......................*.............253........215..........139....583.......
+................225............................................721...814..............829..................*.......613*544.*...=........901.
+..........741.......595.........785.............%677..50................=.................252......710....91...............912.180..........
+...........*...................*....808...956..........+.....812...............*381......*.....676.../..........599....................+....
+............134.184......759..81...*.........*.782........41*......=....125.216........679...../..........@........*.................567....
+.......165.........*......@................66...*.....*.........379.....................................&..626...241........................
+.........*.........232.........387.86...........635.47.806.857.........$537...............240........617..............806..941..........531.
+.......687...654.......735......*...$......................%.....357..............*884.......*571..........273.551......*.....*....576..*...
+............*................648...................716.304..........*...690....663.................*38...........*....365......911....@..424
+....67*156...250..828...................&222.......#...*......16....300.+..................-....-.9....813...982..443.......................
+.....................*......136..757..................65..314...*........................615.291.......&....*................972............
+................721..592...@.............................../...808.............665...176.............................200.....*..............
+..198..459+............................218........-772..............169...39..*........*........939..742......#....=......532...#..264......
+.....*...............$..........713...*............................*.....*...831....689...589*.......*.......91....75.........641...#.......
+..896..167*........372...138...........462...*227..$.....801......512.........................775.673.......................................
+...............47........*.......135...............725.....*...............743..........489*.............735..622.815.551...........519.....
+.......=........*......636.987...*...................................827........496*........48.121................*.....*........#.....*311.
+....525.......819.580.........#.369......119...............77.........*...............10*........*.%.....975.....961....888......304........
+........................96*..........................816............857......=...........376...859.522..=...................................
+629...419..259...#360.......44%.........190..=969...........=...539.....-913.429......................................119.....476...707.....
+...*.....*...*....................*906.*.....................84.....286...............$...=...127.200.465........324.............=.....*599.
+905.....762...262.....-597.....847......311......@654...837............*....455..37..439..147....*.....*...262...*.....787..778.............
+...........................25...........................=...........908....*.......*................827......%....567....-....#.427..819....
+..............................#.$....643=...............................886......243....../.....672..............................*....*.....
+...........185*....107.....226..965........$.................756........................808.221...-.../574...541&...+....871...326....349...
+......................*.....................841.....=...........*688........177................*....................166....*................
+.......189..744......308.......99*391..630/........463......................@...930..........543..........................519...............
+..984.%........-.741.......................................522.915+.....769......*................207....976.....158*.......................
+....*...............*...............&.331...787........48...........224..*......184........874.......=.....*........................537.....
+.....934....*339...829....495.....682...*.............*....+..........*..794..........-430...*....&........848..367....+............*....505
+.........175..........................381............270....198......911...................52......642...............45............445......

+ 98 - 0
aoc2023/day4/README.md

@@ -0,0 +1,98 @@
+--- Day 4: Scratchcards ---
+---------------------------
+
+The gondola takes you up. Strangely, though, the ground doesn't seem to be coming with you; you're not climbing a mountain. As the circle of Snow Island recedes below you, an entire new landmass suddenly appears above you! The gondola carries you to the surface of the new island and lurches into the station.
+
+
+As you exit the gondola, the first thing you notice is that the air here is much *warmer* than it was on Snow Island. It's also quite *humid*. Is this where the water source is?
+
+
+The next thing you notice is an Elf sitting on the floor across the station in what seems to be a pile of colorful square cards.
+
+
+"Oh! Hello!" The Elf excitedly runs over to you. "How may I be of service?" You ask about water sources.
+
+
+"I'm not sure; I just operate the gondola lift. That does sound like something we'd have, though - this is *Island Island*, after all! I bet the *gardener* would know. He's on a different island, though - er, the small kind surrounded by water, not the floating kind. We really need to come up with a better naming scheme. Tell you what: if you can help me with something quick, I'll let you *borrow my boat* and you can go visit the gardener. I got all these [scratchcards](https://en.wikipedia.org/wiki/Scratchcard) as a gift, but I can't figure out what I've won."
+
+
+The Elf leads you over to the pile of colorful cards. There, you discover dozens of scratchcards, all with their opaque covering already scratched off. Picking one up, it looks like each card has two lists of numbers separated by a vertical bar (`|`): a list of *winning numbers* and then a list of *numbers you have*. You organize the information into a table (your puzzle input).
+
+
+As far as the Elf has been able to figure out, you have to figure out which of the *numbers you have* appear in the list of *winning numbers*. The first match makes the card worth *one point* and each match after the first *doubles* the point value of that card.
+
+
+For example:
+
+
+
+```
+Card 1: 41 48 83 86 17 | 83 86  6 31 17  9 48 53
+Card 2: 13 32 20 16 61 | 61 30 68 82 17 32 24 19
+Card 3:  1 21 53 59 44 | 69 82 63 72 16 21 14  1
+Card 4: 41 92 73 84 69 | 59 84 76 51 58  5 54 83
+Card 5: 87 83 26 28 32 | 88 30 70 12 93 22 82 36
+Card 6: 31 18 13 56 72 | 74 77 10 23 35 67 36 11
+
+```
+
+In the above example, card 1 has five winning numbers (`41`, `48`, `83`, `86`, and `17`) and eight numbers you have (`83`, `86`, `6`, `31`, `17`, `9`, `48`, and `53`). Of the numbers you have, four of them (`48`, `83`, `17`, and `86`) are winning numbers! That means card 1 is worth `*8*` points (1 for the first match, then doubled three times for each of the three matches after the first).
+
+
+* Card 2 has two winning numbers (`32` and `61`), so it is worth `*2*` points.
+* Card 3 has two winning numbers (`1` and `21`), so it is worth `*2*` points.
+* Card 4 has one winning number (`84`), so it is worth `*1*` point.
+* Card 5 has no winning numbers, so it is worth no points.
+* Card 6 has no winning numbers, so it is worth no points.
+
+
+So, in this example, the Elf's pile of scratchcards is worth `*13*` points.
+
+
+Take a seat in the large pile of colorful cards. *How many points are they worth in total?*
+
+
+--- Part Two ---
+----------------
+
+Just as you're about to report your findings to the Elf, one of you realizes that the rules have actually been printed on the back of every card this whole time.
+
+
+There's no such thing as "points". Instead, scratchcards only cause you to *win more scratchcards* equal to the number of winning numbers you have.
+
+
+Specifically, you win *copies* of the scratchcards below the winning card equal to the number of matches. So, if card 10 were to have 5 matching numbers, you would win one copy each of cards 11, 12, 13, 14, and 15.
+
+
+Copies of scratchcards are scored like normal scratchcards and have the *same card number* as the card they copied. So, if you win a copy of card 10 and it has 5 matching numbers, it would then win a copy of the same cards that the original card 10 won: cards 11, 12, 13, 14, and 15. This process repeats until none of the copies cause you to win any more cards. (Cards will never make you copy a card past the end of the table.)
+
+
+This time, the above example goes differently:
+
+
+
+```
+Card 1: 41 48 83 86 17 | 83 86  6 31 17  9 48 53
+Card 2: 13 32 20 16 61 | 61 30 68 82 17 32 24 19
+Card 3:  1 21 53 59 44 | 69 82 63 72 16 21 14  1
+Card 4: 41 92 73 84 69 | 59 84 76 51 58  5 54 83
+Card 5: 87 83 26 28 32 | 88 30 70 12 93 22 82 36
+Card 6: 31 18 13 56 72 | 74 77 10 23 35 67 36 11
+
+```
+
+* Card 1 has four matching numbers, so you win one copy each of the next four cards: cards 2, 3, 4, and 5.
+* Your original card 2 has two matching numbers, so you win one copy each of cards 3 and 4.
+* Your copy of card 2 also wins one copy each of cards 3 and 4.
+* Your four instances of card 3 (one original and three copies) have two matching numbers, so you win *four* copies each of cards 4 and 5.
+* Your eight instances of card 4 (one original and seven copies) have one matching number, so you win *eight* copies of card 5.
+* Your fourteen instances of card 5 (one original and thirteen copies) have no matching numbers and win no more cards.
+* Your one instance of card 6 (one original) has no matching numbers and wins no more cards.
+
+
+Once all of the originals and copies have been processed, you end up with `*1*` instance of card 1, `*2*` instances of card 2, `*4*` instances of card 3, `*8*` instances of card 4, `*14*` instances of card 5, and `*1*` instance of card 6. In total, this example pile of scratchcards causes you to ultimately have `*30*` scratchcards!
+
+
+Process all of the original and copied scratchcards until no more scratchcards are won. Including the original set of scratchcards, *how many total scratchcards do you end up with?*
+
+

+ 0 - 0
aoc2023/day4/day4.ol


+ 62 - 0
aoc2023/day4/day4.py

@@ -0,0 +1,62 @@
+import os
+from itertools import accumulate
+from collections import defaultdict
+
+with open(os.path.join(os.path.dirname(__file__), "example.txt")) as example:
+    example_data = example.read().splitlines()
+
+with open(os.path.join(os.path.dirname(__file__), "input.txt")) as example:
+    input_data = example.read().splitlines()
+
+import time
+
+
+def bench(part):
+    def wrapper(*args, **kwargs):
+        start = time.perf_counter()
+        value = part(*args, **kwargs)
+        print(f"\tevaluation time: {time.perf_counter() - start} s")
+        return value
+
+    return wrapper
+
+
+@bench
+def solve1(data):
+    total_points = 0
+    for line in data:
+        line = line.split(": ")[-1]
+        have, win = line.split("|")
+        have = [int(n) for n in have.split()]
+        win = [int(n) for n in win.split()]
+        try:
+            *_, points = accumulate(
+                (1 for _ in have if _ in win), func=lambda x, _: x * 2
+            )
+        except Exception:
+            points = 0
+        total_points += points
+    print(total_points)
+
+
+solve1(example_data)
+solve1(input_data)
+
+
+@bench
+def solve2(data):
+    cards = defaultdict(lambda: 1)
+    for ind, line in enumerate(data):
+        cards[ind + 1]
+        line = line.split(": ")[-1]
+        have, win = line.split("|")
+        have = [int(n) for n in have.split()]
+        win = [int(n) for n in win.split()]
+        mat = sum((1 for _ in have if _ in win))
+        for card in range(ind + 2, ind + 2 + mat):
+            cards[card] += cards[ind + 1]
+    print(sum(cards.values()))
+
+
+solve2(example_data)
+solve2(input_data)

+ 6 - 0
aoc2023/day4/example.txt

@@ -0,0 +1,6 @@
+Card 1: 41 48 83 86 17 | 83 86  6 31 17  9 48 53
+Card 2: 13 32 20 16 61 | 61 30 68 82 17 32 24 19
+Card 3:  1 21 53 59 44 | 69 82 63 72 16 21 14  1
+Card 4: 41 92 73 84 69 | 59 84 76 51 58  5 54 83
+Card 5: 87 83 26 28 32 | 88 30 70 12 93 22 82 36
+Card 6: 31 18 13 56 72 | 74 77 10 23 35 67 36 11

+ 199 - 0
aoc2023/day4/input.txt

@@ -0,0 +1,199 @@
+Card   1: 66 92  4 54 39 76 49 27 61 56 | 66 59 85 54 61 86 37 49  6 18 81 39  4 56  2 48 76 72 71 25 27 67 10 92 13
+Card   2:  8  9 21 99 15 84 39 47 63 18 | 10 50 55 75 78 28 47 19 63 81  8 61  5 66  3  7 12 27 33  9 16 39 17  4 64
+Card   3: 85 17 43 97 49 48 24 72 64 42 | 91 94 18 23 45 95 77  8  5 13 65 66 96 47 86 93 90 98 67 50 20 73 99 32 15
+Card   4: 54 82 19 99  2 28  7 86 41 55 | 14 55 23 88 98 57 79 28 13 34 53 86 39 41 54 99 19 42 25 10  4 47  8 94  2
+Card   5: 49 11 83 64 89 40 19 39  7  9 | 89 43 23 57 24 49 27 37 50 42 58 55  6 81  8 12  2 39 70 94 83 90  4 74 67
+Card   6: 65 11 96 47 25 57 89 88 71 24 |  6 33 38 45 84 74  8 93 67 13 64  2 43 61 15 88 30 22 20 39 68 91 37 18 10
+Card   7: 96 55 17 61 88  8 54 50 22 30 | 61 38 17 74 41 32  1 22 19 50 97 57 86 58 96  4 76 54 55 90 34 85  8 88 30
+Card   8: 70 93 31 55 11 16 69 98 41 64 | 69 11  1  6 48 77 16 88 19 70 42 64 65 43 85 79 98 44 12 55 36 41 13 14 93
+Card   9:  5 95 64 30 40 39 21 51 52 69 | 45 78 12  5 76 49 59 62 41 43 87 47 52 98 61 40 17 55 29 90 54 85 15 79 88
+Card  10: 44 32 54 74 50 77 13 35 95 65 | 22 74 60 18 88 25 73 45 69 47 50 13 99 65  4 16 77 14 81 56 54 58 44 28 61
+Card  11: 68 49 41 59 70 17 56 33 15 63 | 27 12 37 85 39 41 69 86 81 78 87 74 19 68 13  8 50 59 22 98 23 93 91 90 46
+Card  12: 85 46 97 69 87 33 47 92 80 54 | 66 78  7  6  9 87 73 29 81 93  4 97 24 14 13 31 52 74 79 28 18 83 51 10 61
+Card  13: 23 75 54 97 92  4 41 99 95 56 | 63 92 71 99 25 53 57 97  4 23 34 40 22 27 59 41 70 75 46 10 67 65 29 95  7
+Card  14:  4 43 73 89 85 41 60 58 47 42 | 56 42  1 94 33 43 47 50 79 12 90 91 65 88 60 63 53 55 27 59 85 41 78 72  9
+Card  15: 72  4 73 56 11 26 45 23 89 14 |  9 40 30 55 69 95 72  3 49 88 61 71 13 67 38 59 23 36 87 89 93 53  8 73 14
+Card  16: 90 34 79 48 37 99 63 10  2 13 | 13 74 83 75  8 59 40 25 26 47 66 41 23 82 10 89 43 38 56 96 94 90 42  5 88
+Card  17: 55 78 73 65 49 48 15 11 16  4 | 14 98 80 73 82 21 88 22 72 85 99 42 57 78 62 77 29 11  8 86 74 30 91 95 48
+Card  18: 53 33 61 49 46 45 66 10 16 35 | 45  3 63 52 55 97 10 60 11 21 33 24 65 17 30 58 77 56 13 62 44 82  6  5 29
+Card  19: 85 19  4  3 80 28 39 20 35 30 |  2 63 32 12 21 15 77 13  6 55 27 81 49 74 99 20 72 94 60 37 41 50 24 69 17
+Card  20: 22 34 49 33 29 11 39 30 84 32 | 86  9 25 18 54 13 80 94 32 11 69 61 48  7 64 70 43 56 74 35 87 12 38  4 89
+Card  21: 73  8 49 77 69 29 42 32 80 91 | 93 47 14 28  2 18 86 87 62 85 57 64 50  3 67  1 95 19 71  9 31 44 52 58 25
+Card  22: 70 27 22 21 28 51 89 62 77  7 |  6 49 36 94 64 61 52 41 99 86 32 47 53 54 69 12 84 58 57 81 23 63  4 55 38
+Card  23: 31 22 64 50  3 18 34 41 67 47 | 22 64 81  3 73 19 18 80 50 85 48 31 70  8 34 47 43 41 69  6 67 75 74 83 92
+Card  24: 54 93 70 46 83 26 61 49 30 87 | 16 97 22 80 54 49 55 70 56 46 83 59 26 93 21 14 30 87  4 84 33 61 81 98  9
+Card  25: 74 11 97 31  5 24 52 27 51 76 | 95 51 11 27 87 60  5 53 50 63 45 97  6 74 66 84 75 31 24 52 99 56 76 17 10
+Card  26: 22  1  7 80 31 15 69 91 19 48 | 25 97 21 74 24  7 15 77 75 76 52 37 80 28 89 36 65 32 33 91 10 22 48 70 59
+Card  27: 82 95 44 42  7 68 83 43 86 47 | 64 50 47 13 15 92 94 65 25 57 46 95  2 77 32 28 14 85 81 90 52 83 22 19 53
+Card  28: 14 13 12 27 98 60 92 79 49 66 | 68 75 94 54 47 58 28 36 72 90 73  2  4 79 59 97 20 33 55 63 99 65 19 81 86
+Card  29: 50  3 21 88 22 78 29 99 45 18 | 37 58 60 99 55 49 63 50 47 54  8 77 88 15 84  9 26  1  3 79 24 14 22 97 28
+Card  30: 95 62 97 61 40 48 46 22 73  2 | 19 68 46 74 82 57 99 90 49 79 61 26 77 88 33 94 13 98 16 63 40  4 14 15 59
+Card  31: 93 95 81 21 34  9  6 47 96 94 | 95 89 31 94 21 59 86 48 64 81 28  5 71 47 84 51 11 79 15 91 98 29 23 24  6
+Card  32: 99 57 79 76 88 34 85 35  3 81 | 12 38 52 20  9 86 54 77 48 93 71 45 92 69 32 59 13 18 50 87 56  4 73 39 96
+Card  33: 64 36 39 42 81 70 57 22 19 83 |  7 18 17 84 61 94 72 52 55 44 39 49  6 74 76 45 85 30 48 20 33 83 34 98 73
+Card  34: 58 27 41 83 17 92 89 86 60 43 | 55 37 70 68 39 86 13 92 18 40 60 38 89 41 28 43  3  2 30 95 45 51 74 17  7
+Card  35: 54 84 96 24 41 30 75 53  3 49 | 68 53 47 12 67  3 29 35 81 42 19 23 45 52  8 96  9  5 87 15 90 40 62 77 33
+Card  36: 43 13 23 87 80  4 45 17 97 22 | 34 13 79 53 45 74 17 44 28 40 97 87 60 43 46  4 25 27 11 56 31  5 93 18 99
+Card  37: 78  2 47 82  7 66 64 14 16 81 | 29 67  3 47 18 58 57 25 39 10 15 56 86 13 72 34 74 61 79 26 31 38 81 89 71
+Card  38: 51 74 98 82 79 13 90  3 38 69 | 16 41  7  4 90 22 58 18 51 79 13 74  3 45 47 82 40 69 54  1 89 78 70 84 23
+Card  39: 50 70 52 29 69 11 86 73  5 18 | 87 62 27 68 47 28 99 92 85  9 88 31 30 17 25 59 69 51 66 61 16  5  1 80 13
+Card  40: 82 61 98 72 81 93 15 50 68 48 | 57 86  1 39 22 62  3 35 24 69 67 94 90 41  9 70 82 87 56 92 97 21  7 30 17
+Card  41: 96 24 98 53 19  1 84 32 90  2 | 18 14 31 83 34 99 71 79 50 61  2 54 62 89 25 45 29 35 44 98 76 38 86 20 85
+Card  42: 49 37 17 74 38 87 66 73 68  7 |  5 49 84 26 62 23 14  7 68 34 25 65 39 16 44 61 82 87 69 10 45 74 97 81 13
+Card  43: 77 37 23 93  2 48 54 61 81 74 |  5 44 86 83 38 15 49 13 80 40 65 16  4 62 85 25  8 58 66 45  7 87 75 33 30
+Card  44: 76 35 10 55 88 26  1 48 33 22 | 52 30 61 62  9 20 86 90  3 96  1 22 99 67 95 66 11 31 94 38 21 47 16 89 80
+Card  45:  1 28 48 62 99 21  9 45 30 10 | 13 20  4 58 66 72 14 41 85  7  8 31 69 22 64 67 32 91 59 57 27 50 23 89 38
+Card  46: 45 17  4 97 37 92 71 56 81 95 | 28 43 40 64 33 35 10 83 65 38 41 95 72 15 73 19 23 24 26 87 11 98 18 48 79
+Card  47: 44 11 20  5  3 64 78 60 41 84 | 81 62 45 99 59 75  8 13 82 88 35 83 30 87 96 21  2 49  1 48 77 73 71 43 51
+Card  48: 25 45 65 44 55 16 27 48 81 64 | 65 31  3 18 15 68 71 44 62 42 48 49 27 34 75 89 84 35 93 73 29 99 55 32 98
+Card  49: 42 94 97 36 96 18 19 69 98 22 | 77 58 40 53 57 97 91  6 86 20 35 78 26 93 85  9 68 10 96 99 21 62 29 16 81
+Card  50: 81 45  6 37 19 72 40 23 65 71 | 99 12 71 25 34 40 18 32 48 37 43  9 14 98 77 45 42 90 74 96 92 53 97 72 89
+Card  51: 47 57 22 48 44 15 85 93 81 54 | 69 55 11 87 49 14 78 22 10  7 68 53 43 38 48 94 28 18 30  9 56 44 91 85 15
+Card  52: 20 34 38 61 62 17 50 33 59  7 | 93 35 67  7 61 62 95  6 42 40 50 80 13 88 72 37 32 59 53 71 18 96 58 86 55
+Card  53: 65 41  5 79 67 35 55 25 45 42 | 65 96  1  5 11 98 92 15  4 45 86 63  8 20  6 72 26 97 25 21 78 87  2  7 61
+Card  54: 79 12  1 74  8 85 25 69 29 59 | 97 26 71 79 82  1 61  5  4 59 29 69  6 31  8 75 85  2 12 19 72 70 32 39 55
+Card  55: 72 98 84 44 37 56 75 42 68  8 | 91 32 82 44  4 52 59 30 55 18  8 79 36 61 72 20 58  9 69 84 54 68 63 60 77
+Card  56: 43 80  7 27 66 79 26 50 63 72 | 26 52 17 41  5 79 11  9  1  2 57 72 60 33 54 22  7  4 27 82 85 47 12  8 10
+Card  57: 81 93  2 31 20 34 53 98 90  1 | 30 69 32 65  9 80 84 94 37 78 26 18 13 15 12 17 91 74 34 73 81 43  4 46 38
+Card  58: 86  8 51 30 44 81 62 10 95 91 | 31 15 45  2 11 52 99 87 49 55 21 53 66 88 70 28 61 74 38 80 67 69 43 14 32
+Card  59: 67 60 59 87 52 39  7 65 98 30 | 51 53  4 27 14 25 88  8 41 39 86 96 38 75  9 11 76 10 55 78 93 18 85 35 84
+Card  60: 58 39 34 31 66 40 80 24 78 71 | 89 33 91 60 16 35 18 70 22 41 54 75 37 99 53 32  2 55 46 19 84 63 15 72 25
+Card  61: 26 53 99 43 93  9 37 38 65 46 | 97 68 54 87 24 78 88 19 91 90 95  2  7 84 67 29 22 27 28 23  8 51 42 31 16
+Card  62: 71 32 42  7 68 17 29 93 99 55 | 16 88 85 40 11 49 75  9 15 46 70 31 58 22 18 64 79 86 28  1 27 35 54 50 43
+Card  63: 78 58 70 40 11 62 24 19 16 68 | 62 59 44 31 97 11 94 78 83 64 43 40 58 36 98 16 20 68 19  1 84 46 29 24 70
+Card  64: 88  7 39 76 19 53 35 28 20  1 | 46 20 66  1 44 39 60 30  7 76 56 18 42 61 14 57 84 23 89 54 10  2 93 58 80
+Card  65: 20 12 95 39 73  7 48 67 28 62 | 60  1 69 81 63 47 25 10 76 27 12 20 28 48 52 16 89 95 57 59 17 62 72 61 99
+Card  66: 46 93 50 57 53 62  8 69  7 23 |  6 34 82 29 71 45 60 61 25  8  1 85 98 83 13 46  4 42 59 43 44 11 16 28 81
+Card  67:  9 32 39 18 15 33 16 84 34 35 | 18 39 52 46 84 60  9 32 35 79 16 77 80 72 15  6 36 88 65 34 78 67 83 33 87
+Card  68: 29 99 33 41 36  3 43 60 27 72 | 95 16 85 72 36 40 29 69 41 27 14 97 20 84 33 90 75 99 60 81 43 58  3 74 45
+Card  69:  2 31 13 80 84 15  5 66 40 26 | 19 86 55  9 46  5 39 96 64 58 54 48 26 32  2 53 62 77 79 94 70 16 35 92 68
+Card  70: 15 13 48 63 82 71 19 11 51  1 | 18 95 50 67 13 97 96 73 41 60 86 64 42 72 82  3 94 85 69 31 36 17  2 76 39
+Card  71: 58 50 73 38 41  6 98 34 90 28 | 81 90 47 25 94 59 36 75 89 63 28 58  6 83 43 85 29 19 53 73 49 98 41 50  4
+Card  72: 13  6 65 15 77 12 97  4 93 56 | 36  3 67 74 10 20 26 22 39 84 31 98 71 38 79 62 87  2 70 25 46 50 27 53  5
+Card  73: 67 29 98 90 80 25 65 42 14 47 | 78 12 88 41 86 16 48 89 47 79 29 58 39 57 80 37 98 24 14 18 67 90 62  1 11
+Card  74: 37 77 62 93 28 75 97 21  2 88 | 73 10 89 57 70 29 36  1 65 59 82 26 75 63 66  4 44 20 90 28 50 93 15  2 33
+Card  75: 34 50 51 23 67 91 95 37 92 89 | 17 90 35 32 87 53 40 79 81 27  1 24  8 45 75 46  4 52 62  3 43 86 25 94 41
+Card  76: 34 98 36 50 53 80 82 56 29 67 | 13 21 27 11 39  7 34 78 37 41 56 77 82 12 29 64 35 65 76 96 73 68 20 58 53
+Card  77: 38 39 60 78 43 76 24 86 79 87 | 93 89 43 91 83 25 82 69 86 59  5 18 60 65 72 99 22 74  3 50 24 85  6 73 26
+Card  78: 23 70 14 53 65  6 44 85 71 99 | 95 82 73 81 40 32 49 75 47 11  1 57 39 34 74 13 42 45 79  6 37 69 20 76 56
+Card  79: 76 55 94 36 70 84  5 27 86 29 | 26 60  9 46  7 12 65 54  8 68  6 16 85 28 21 49 72 62  3 43 61 67 24 66 33
+Card  80: 48  8 42 24 83 87 44 90  4 68 | 68 34 84  1  9 41 79 67 22 91 32 28 11 53 35 83 43 98 40 95 38 50 57 30 45
+Card  81: 35  8 64  4 98 87 31 71 14 74 | 92 68 73 77 59 93 27 21 18 13  2 39 52  1 63 55 82 34 32 90 26 23 37 47 10
+Card  82: 99 84 98 14 29 78 17 24 94 92 |  4 70 73  3 60 55 76 71 79 50 58  7 61 40 38 46 43 56 90 42 22 54 16 15 32
+Card  83: 93 64 53 42 71 56 66 13 65 40 | 53 42 51 62 94 39  9 71 64 13  7 93 85 46 55 56 83 88 66 75 65 58  5 30 40
+Card  84: 64 83 75 15 84 35 71  4 36 51 | 89 83 75  4 22 32 16 17 88 23 10 81 93 99 67 53 51 84 66 64 30 28 39 36 71
+Card  85: 63 32  2 22 30 96 37 60 93 86 | 44 11 59 51 40 73 64 63 20 42 68 90 49 52 77 38 70 28 76 61 65 47 83 58 92
+Card  86: 60 68 98 62 30 44 61 91 72 75 | 30 54  1 10 38 25 40 15 81 83 39 16 36 79 52 72 37 35 46 61 95 32 31 64 56
+Card  87: 63 26  7 44 97 19 20 23 34 58 | 86 62  1 81 53 32 39 76 55 31 41 96 94  2 43 33 88 73 92  5 67 91 36 74 46
+Card  88:  2 26 86 57 37 30 50 14  8 62 | 26  4 88 14 57 22  2 50  8 43 98 70 30 62 94 77 92 37  6 49 76 85 65 86 18
+Card  89: 71 40 38 74 67 33 56 21 89 64 |  4 32 84 96 41 47  3 81 86 49 29 68 55 92 72 30 69 90 27 10 59 28 71 24 78
+Card  90:  2  7 41 33 48 69 70 99 17 30 | 84 75  2 62 50  7 34  4 85 48 33 74 13 40 11 31 99 17 70 58 59 18 30 32 88
+Card  91: 22 48 46 16 20 42 59 62 71 50 | 66 21 85 62 38  4 53 74 47 27 35  2 50  9 29 28 48 63 34 78 10 59 12 42 91
+Card  92: 99 90 59 33 24 52 15 62 43 54 | 50 49 71 45  6 31 42 38 23 54 70  4 59 24 72 91 15  3 60 66 33 90 65 20  5
+Card  93: 18 58 48 84 25 83 92  1  5 15 | 40 23 92 67 64  7 42 80 94 88 45 81 13 60 84 31 66 65 27 39 74 50 79 32 59
+Card  94: 26 31 95 29 75 82 46 51 67 91 | 95 26  3 72 80 67 96 27 81 15 18 77 58 39 51 34 45 44 37 24 84 63 31 12 46
+Card  95: 25 98 20 59 29 24 62 16 74  3 | 59 25 40  9 10 53 34 51 33 80 22 15 14 19 98 36 27 16 13 32 86 65 18 60 35
+Card  96: 23 13 48 91 43 70 21 94 10 31 | 24 52 69 17 51 28 72 60  1 76 79 71 45 49 82 63  5 96 13  9 98 75 26 66 34
+Card  97: 80 98 77 42 27 29 86 60 97 59 | 37 72 48 14 64 80 62 30 27  2 50 17 77 40 41 11 51 70 55  4 87 86 61 26 12
+Card  98: 64 27 56 90 14 92 69 17 79  3 | 47  2 40 32 62 80  5  8 35 88  7 91 20  4 75 61 19 42 13 98 66 65 85 74 11
+Card  99: 96 64 28 89 69 79 15  1 70 26 | 24 64 92 28 17 47  5 86 66 36  7 57 12 80  2 50 27 91 68 29 48 10 87 51  8
+Card 100: 98 63 40 41 13 24 95 70 25 51 | 44 49 91 93 96  4 69 18 36 29 32 57 61 66 82  6  9 99  7 39 20 90 38 58 21
+Card 101: 85 67 80 27 33 81 55 71 99 74 |  4 98 95 64 63 34 15 59 79 82 72 84 39 70  2 32 49 41 13 56 17 97 42 57  9
+Card 102: 95 17 65 25 96  8 92 69  2 52 | 37 36 78  8 32 58 82 89  9 25 17 92 52 83 88 10 87 76 96 12 95 65 69 22  2
+Card 103: 43 55 38 59 96 36  6  7 69  1 | 65 68 17 70 38 67  3 83 47 94 55 74 91 20 43 96  6 34 36 53 69 25  1  7 59
+Card 104: 34 76 55 64 54 28 52 60 24 25 | 25 55 28 73 45 84 47 53 79 27 49 91 66 54 64  7 76 39 83 24 34 60 97  8 52
+Card 105: 85 32 71 95 81 33 51 91 35 65 | 32 76 85 35 75 74  5 65 81 49 84 91 62 19 30 95 69 51 96 33 71 80 41 15 14
+Card 106: 64 66  4 41 49 19 28 74 85 59 | 74  5 15  8 80 20 67 28 84 41 24 19 40 35 66 51 64 34 37 10 59 49 30 85  4
+Card 107: 34 78 82 54 88 36 87 70 38 91 | 70 54 78 17 40 89 92 99 11 66 32 72 62 87 91 88 34  2 73 82 12 23 30 75 96
+Card 108: 55 19 97 86  8 87 14 54 13 95 | 65 19 43 15 79 23 21  8 95 54 86 81 96 55 85  1 14 87 97 64 11 35 12 13 52
+Card 109: 12  8  9 85 37 36 28  6 62 94 | 12 83  8 47 94 26 91 62 18  6 20  9 36 28 48 37 45 93 88 77 74 13 85  5 49
+Card 110: 55 22  9 30 57 77 21 84  2 67 | 36 23 67 22 33 15 27 95 53 98 63 31 50 25 96 54 87 52 59 74  5 91  2 21 41
+Card 111: 73 64  4 67  5 41 66 70 74 98 | 99 82 67  2 45 60  4 75 29 81 70 87 68 63 74 41 86 78 31 38 28 89  3 98 65
+Card 112: 29 93 48 19 39 99 96 31 25 63 | 12 18 90 82 20 93 63 34 81 19 31 37 99 36 42 48  2  8 39 49 96 54 25 92 29
+Card 113: 42 32 64  9 38 37  6 20 88 65 | 35 31 86  5 99  2 52 20 93 11 74 92 27 62 37 26 58 60 46 18 94 39 59 87 56
+Card 114: 45 27 68 81 95 54 70 98 88 99 | 75 10 18 70 31 85 68 86 48 39 69 81 94 54 97 56 46 57 62 25 91 98 65 12 45
+Card 115: 47 23 97 32 52 25 51 35 10  5 |  4 83 49 42 80 25 86  6 57 93 36 82 59  1 56 66 73 89 14  8 71 39 20 95 97
+Card 116: 36 41 79 63 21 49 40 58 95 97 | 49 79 32 88 21 82 75 28 98 77 15 64 23 18 44 85 36 50 40 26 97 22 95 63  2
+Card 117: 53 74 43  3 22 42 13 36 54 59 | 34 77 10 57 74 70 42 22 14 69 46 54  5  3 12 35  8 56 78 36 80 86 92 85 98
+Card 118: 53 26 17 38 92 76 83 58 90 31 | 78 85 52 42 58 95 88 30 15 71 17 73  6 92 38 91 10 31 19 72 40 51 68 76 94
+Card 119: 55 67 27 20  5 11 80 98 21 97 | 83 31 11 62 75 10 14  7 97 98 96 36 16 18 45 55 44 81 27  9 69 80 43 41 66
+Card 120: 42 81  4 82 50 16 66 25 35 74 | 46 88 97 52 40 27  2 70 49 79  8 18 20 11 78 58 26 28 24 61 30 68 72  6 14
+Card 121: 74 73 20 11 50 94 56 46 19  6 |  7 26 74  6 93 15 51 91 47 35 19 84 29 69 96 92 88 24 82 31 12 71 85 65 55
+Card 122:  7 38 60 84  4 10  6 95 76 19 | 33 67 73 12 96 97 78 62  4 42 29 20 77 32 52  2 23 19 72 93  7 81 55 82 76
+Card 123: 71 88 20 45 38 28 27 37 52 49 | 53  5 85 42 80 41 89 14 47 98 83 68 17  8 32 12 90 71 55 30 82 16 33 77 59
+Card 124: 17 47 72 21 32 23 40 39 43 84 | 75 63 13 54 80 45 71 55 38 34 89 36 46 15  6 82  2 99 98 35 73 25 22 79 41
+Card 125: 98 88 35 63 62 60 58 61  1 97 |  1 71 41 67 86 16 93 74 95 64 91 12 79  6 80 20 31 25 44 33 26 55 87  7 47
+Card 126:  9 99 24 63 52 60 62 85 98 64 | 47 54 91 58 35 78 77 38 10 94 34 65 86 95  7 44 61 90 92  4 31 48 13  6 49
+Card 127: 88 55 26 91 34 38 46 79 92 12 |  7 88 67 82 94 93 63  6 47 49 57 52 32 38 61 77 69 51 81 25 92 36  5 39 11
+Card 128: 19 72  9 81 37 93  6 22 53  3 | 60 26 22 47 72  9 40 98 53 50 37 49 88 93  6 82 89 81 16 84 51 75 28 56  3
+Card 129: 53 28 43 67 89  2  9 83 82 14 | 53 68 42  4 92 69 95  2 33 78 97  1 72 14 45 46 13 44 26 90  8 34 20 81 77
+Card 130: 41  5 12 24 37 59 45 20 74 68 | 94 30 19 12 45  5 62 74 48 73 59 20 50 25 41 26 96 66 37  7 55 44 24 68 88
+Card 131: 49 35 40  4 15 12 13 28 70 81 | 38 70 31  2 12  4 74 15 13 50 81 29 99  9 42 65 46 54 40 32 11 34 49 28 86
+Card 132: 71 89 67 34 66 24 18 17 80 36 | 55 77 17 22 16 98 47 54 56  2 48 89 43 91 95 66  9 20 40 37 42 29 25 27 34
+Card 133: 87 59  6 34 33 73 26 72 17 60 | 75 60 58 22 19 31 79 52 72 71 21 33 73 35 51 18  8  2 64 57 74 81 76 87 32
+Card 134:  5 65 81 19 87 84  4 28 86 90 | 46 83 98 49  1 29 13 76 23 38 74 50 37 30 25 16 73 84 53  3 47 85 77 95 75
+Card 135: 73 71 76 33 38 61 88  4 91 97 | 83  5 27 80 37 43 28  2 12 82 62 90 38  7 25 76 34 85 29 89  9 71 54 95 49
+Card 136: 93  1 31 90 94 15 87 79 14 78 | 82 41 93 25 15 78 70 27 90 55 87 34 80 31  4 86 72 51 77 94 75 56 20  2 99
+Card 137: 44  5 82 35 71 81  1 60 55 32 | 36 46 86  9 65 16 78 28 35 70 15 55 66 42  7 14 23 26 75 24 88 87 38 12 92
+Card 138: 31 28 92 12  4 47 70 20 55 44 | 76 85 73 92 61 27 36 90 53 78 79 18 10 63 95 15 74 20 39  4 60 91 47 19 87
+Card 139: 46 42 19 87  2 24 31 63 26 47 | 14 87 76 16 69 77 17 30 32 24 80 28 45 64 26 47 67 13 82 57 55 88 37 15 41
+Card 140: 32 99  2 23 14 89 51 54  8 69 | 46 15 32 62 30 92 71 47 49 96 44 80 98 10 67 27 93 76 87 19 18 40 64 31 72
+Card 141: 88 59 11 19 95 39 31 43 79 94 |  9 93  3 49 33  8 10 61 35 71 51 20 13 69 91 30 27 23 84 40 60 76 29 55 66
+Card 142: 63 97 79 19 30 45 33 14 64 13 | 85 83 73 36  9  8 43 88 72 90 48 35 33  5 98 93 39 46 91 20 69 34 80 77 23
+Card 143: 16 32 97 62 81 76 21 79 86 42 |  4 82 59 99 96 49 52 56  6  1 92 91 94 10 48 15 69 18 24 72 83 47 34 77 65
+Card 144: 25 96 44 94  8 37 57 58 41 80 | 72 94 25 13  8 70 26 43 60 58  9 66 37 57 96 51 67 41 88 22 73 44 34 82 80
+Card 145: 94 41 79 86 90 78 85  2 95 24 | 57 71 95 79 25 85 41 18 75 43 47 63 46 28 64 89 48 55 17 70  2 54  8 16 81
+Card 146: 31  2 38 95 65 35 40 36 16  9 | 68 38 28 15  7 65 90 31 79 71  2 35  9 70 16 62 58 57 60 17 36 95 40  6 59
+Card 147: 46 26 34 79 51 76 57 45 52 41 | 46 47 33 79 69 59 32 16 28 99 93 44 39 90 45 48 51 75  9 66 22 86 25 58 12
+Card 148: 83 60 57 71 59 61 76 75 96 82 | 34 76 25 38 31 71 59 12 82  1 61 29 37 62 21 77 63 57 75 83 24 97 60 96 46
+Card 149: 47 35 60 76 40 11 63 34 79 73 | 73 70 48 58 78 37 89 20 95 17 46 66 57 99 98 19 51 65 69 13 62  6 61 11 63
+Card 150: 76 17 13 40 36 24 27 32 77  4 | 76 80 63 77 92 89 69 37 48 54 73  6 82 22 46 62 14 13 75 10 88 60 24 40 99
+Card 151: 90 98 22 69 67 14 39 85  3 57 | 67 87 18 22 74 13 33 46 68 85 24 15 14  5 98 17 30 36 77 66 16 89 48 39  3
+Card 152: 58 76 44 63 94 36 78 30 34 47 | 21 70 67  5 75 34 83  6 18 53 36 65 19 28 88 55 61 42 92 11 48 23 96 63  9
+Card 153: 20 11 24 87 38 45  1 19 57 83 | 83 89 71 21 31 96 55 34 88 53 51 18 15 82 24 92 87 59 17 67 43 20 68 45 57
+Card 154: 85 57 93 38 35  8 59 67  6 30 | 97  7 98 69 91 58 24 78 46 75 62 89 55 20 51 95 17 74 72 49 27 45 36 52 83
+Card 155: 14 72 37 30 47 58 44 21 74 11 | 66 38 83 88 64 10 57 18 30  9 82 28 17 61 15 48 20 34 14  7 79 26 63 44  8
+Card 156: 38 93 54 22 40 12 63 80 55  8 | 36 32 71 52 17 97 64 80 38 47 34 22 63 24 62 84 98 23 54  8 76  5 45 61 20
+Card 157: 76 81 52 37 46 82 47  5 60 26 | 28 20 83 40 71 68 84 66 72  5 69 79 29 52 81 51 64  2 55 63 26 56 76 32 31
+Card 158: 12 89  2 74 11 28 94 83 85 68 | 63 32 35 52 19 44 66 87 70 99 38 95 53 82 16 30 29 21 59  3 25 50 26 69 18
+Card 159: 62 82 61  8 23 18 25 14 68 95 | 51 13 11 36 56 29 92 79 19 49 28 77 82 96  8 58 97 73 95 72  6  2 67 91 48
+Card 160: 55 80 19 90 66 63 59 89 73 23 | 39 91 10 61  1 69 20 93 60  9 99 72 26 45 52 74  5 64 83 24 14 22 15 27 86
+Card 161:  9 11 72 31 24 68  3 36 16 59 | 56 92  7 75 80 91 44 78 84 12 22  4 17 37 42 63 49 67 70 26 43 39 66 90 27
+Card 162: 18 99  9 68 64 81 42 24 47 91 | 80 29 96 98 33 83 27 43  4 10 61 48 44 35  8 59 30 72 54 14 50 22 74  6 13
+Card 163: 77 29  4 87 21 68 53 98 45 95 | 32 50  1  6 23 97 64 61 36 47 86 60 92 15 78 74 75 37 90 72 28 73 55  3 35
+Card 164: 31 52 49  7 85 47 68 50 71 46 | 74 91 52 37 35 60 71 50  7 29 43 82 47 34 63 94 49 85  3 28 68 31 97 46 95
+Card 165: 76 50 46 25 96 45 65 55 57  7 | 56 44 52 61  3 69 72 90 86 91 87 53 95 68 83 84 82 59 23 73 48 88 81 66 28
+Card 166: 77 59 67 43 64  4 82 56 98 76 | 59 61 16 72 82 52 76 90 44 54 32 67 64 33 80 97 35  8 56  4 92 21 77 98 43
+Card 167: 43 14 22 45 58 46  5  3 86 37 | 86 65 22 24 25 80 97  3 32 69 31  5 14 66 58 87 46 21 37 59 99 43 28 45 91
+Card 168: 18 22 61 21 45 33 49 96 83 38 | 18 38 83 48 87  6 20 91 23 28 11 45 30 21 17 33 96 61 95 49 74 77 69 22 80
+Card 169: 99 12 78 48 92 51  8  6 14 45 | 46 64 80 60  9 78 54 45  1 83 59  3 14 22 11 12 29 44  5  8 61 37 49 74 38
+Card 170:  9  3 45 53 23 13 43 34 76 44 | 59 60 20 91 64 65 52 13  6 44 29 12 25 66 63  3 62 72 68 76 77 43 34 31 53
+Card 171: 27 50 54 11 90 17 80 74  7 34 | 90 40 57 15 50 74 26 53  7 80 52 31 38 54 34 17  5 46 47 27 39 48 19 11 32
+Card 172: 26 88 29 44 70 90 51 91 43 39 | 66 85 26  6 43 44 74 84  4 39 89  8 40 22  7  2  3 54 75 29 20 55 34 60 88
+Card 173: 82 41  1 85 80 29 53 47 73 37 | 12 96 90 36 33 68 92 57 71 65 63 76  3 84 43 35 28 22 97 88 94  5 73  7  4
+Card 174: 10 32 78 50  4 89 14 41 70 19 | 10 19 71 77 21 24 13 36 69 74 32 47 37 41 57 75 70 17  4 60 14 22 64  2 88
+Card 175: 48 73 37 77  1 62  3 90 16 82 | 98 25 86 30 97 46 55 31 23 78 40 27 43 71  1 18 29 92 77 70 73 15 57 37 45
+Card 176:  9 24 81 66 77 87 71 63 76 69 | 67 79 49 57 40 77 80 36 24 69 76 83  2 72 97 63 42 87 33 39 20 35 61 66 13
+Card 177: 28  1 81 43 11 14 85 16 22 96 |  7 59 48 34 26 55 13 61 84 30 39 35 88 42 71 52 24 32 89 80  5 29 94 40 97
+Card 178: 86 83 31 11 98 17 40 36 62 24 | 19 26 46 43 73 81 68 75  9 55 44 92 61 57 96 99 62 58 17 98 72 38 64 32 59
+Card 179: 57 18 30 56 69 39 54 20 16 96 | 49 94 24  8 62 79 56 43  4 77 23 76 74 55 82 98 28 65 89  2  5 87 34 13 71
+Card 180: 96 90 19 27 25 64 33 46 42 45 | 29 77 54 45 40 11 66 38  9 80 32 60 42 51 47  4 15 23 87 26 27 57 14 28  2
+Card 181: 33  2 97 78 52 35 53 34 87 46 | 56 23  9 59 60 75 13 24 27 68 76 98 12  2 63 54 47 16 69 85 71 79  3 93 64
+Card 182: 16 26  4 13 81 34  5 90 11 65 | 52 72 86 38 59 46 18 76 33 66 99 87 45 36 69 43 35 27 97 37 77 62 12 67 96
+Card 183: 29 30 38 95 42 14 91 33 69 36 | 66 39 75 12 92 47 94 17 13 73 99 54 89 16 68 41 10  7 48 25 20 24 61 31 60
+Card 184: 87 62 63 51 65 26 96  5 72 28 | 90 62 21 87 51 96  3 66 32 63 45 11 38 28  5 83 67 75 65 26 74 13 72  7 98
+Card 185: 19 76 22 24 34 98 56 90 70 49 | 34 70  2 50 23  9 90 28 64 19 17 73 39 76  8 22 49 77 56 24 27 55 75 98 91
+Card 186: 28 26 65 98 88 50 44 83 47 24 | 92 80 91 51 87 58 31 46 48 39 76 29 14 56 42 36 79 67  2 78 20 72 62 35 19
+Card 187: 10 39 36 96 21 90  9  3 29 69 | 57 39  1 96 90  2 95 29 32 74 53 84 70 22 26 12  9 38 81 50 80 62 75 10 97
+Card 188: 53 32 89 13 31 50  1  3 70 99 | 91 78 23 65 20 63 70 13 66 99 34 54  3 14 27 44 71 28 53 19 50 89 32 31 61
+Card 189: 53 87 69 96 46 70 90 18 23 93 | 91 39 79 69 71 70  5 88 12 53 56 65 74 36 64 18 24 45 31 35 77 96  7 86 66
+Card 190: 63 35 27 25 78 43 86 53 29 74 | 60 72 33 19 53 96 43 84 83  5 29 81 65 22 46 30 41 27 26 42 50 97 64  7 21
+Card 191: 91 93 37 42 76  2 69 89 66 80 | 45 19 24 92 38 21 76  7 60 14 75 81 32 65 12 53 58 35 67 33  3 68 42 22 34
+Card 192: 17  5 29 67 35 41 14 52 97 10 | 71 76 61 93 20 41 94 16  3 31 26 95 78 64 82 38 92 85  7 43 24 89  8 28  4
+Card 193: 17 77 69  4 96 22 99 56 93 85 | 50 97 82  8 54 40 91 83 65 24 88 16 12 67 17 22 45 15 93 63 27 23 78 10 85
+Card 194: 42 64 40 85 20 26 76 29 34 56 | 12 34 41 57 55 15 27 47 67 50 31 86  7 18 25 43  3 48 85 64  9 71 17 37 73
+Card 195: 33 68 37 22 85  4 25 99 41 26 | 69 78 34 31 40 66  9 35  1 29 46 91 25 56 88 86 38 75  3 28 20 97 53 41 42
+Card 196: 35  6 57 59 13 92 46 22 84 80 | 72 66 22 77 63 74 51 34 53 99 47 68  6 96 88 32 83 93 52 78 56 89  4 11 28
+Card 197: 75 37 74 76 59 12 58 39 84 45 | 50 97 32 99  3 56 81 68 11 75 93 53 96 66 12 21 35 25 77 18 72 13 80 98 71
+Card 198: 90 56  5 35 91 61  7 20 68 40 | 17 47 66 10 73  8 51 13 53 58 45 36 34 54 23 92 64 28 27 71 22 52 18 69 24
+Card 199: 16 23 27 61 14 11 89 80 98 88 | 57 48 25 66 72 45  2 33 93  9 73 58 94 79 40  6 47 19 78 69 70  8 30 29 34