commit ae00eb4f8058de29d4b6acf5c2c83f9a527fe47d Author: Fabian Schmidt Date: Fri Oct 25 11:07:47 2024 +0200 Moved aoc challenges from their own repos to this one diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..030b049 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,43 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "y2015" +version = "0.1.0" + +[[package]] +name = "y2016" +version = "0.1.0" + +[[package]] +name = "y2017" +version = "0.1.0" + +[[package]] +name = "y2018" +version = "0.1.0" + +[[package]] +name = "y2019" +version = "0.1.0" + +[[package]] +name = "y2020" +version = "0.1.0" + +[[package]] +name = "y2021" +version = "0.1.0" + +[[package]] +name = "y2022" +version = "0.1.0" + +[[package]] +name = "y2023" +version = "0.1.0" + +[[package]] +name = "y2024" +version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..1eb683a --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,14 @@ +[workspace] +resolver = "2" +members = [ + "y2015", + "y2016", + "y2017", + "y2018", + "y2019", + "y2020", + "y2021", + "y2022", + "y2023", + "y2024", +] diff --git a/y2015/Cargo.toml b/y2015/Cargo.toml new file mode 100644 index 0000000..d2b71d3 --- /dev/null +++ b/y2015/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "y2015" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/y2015/src/lib.rs b/y2015/src/lib.rs new file mode 100644 index 0000000..e69de29 diff --git a/y2016/Cargo.toml b/y2016/Cargo.toml new file mode 100644 index 0000000..8812d24 --- /dev/null +++ b/y2016/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "y2016" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/y2016/src/lib.rs b/y2016/src/lib.rs new file mode 100644 index 0000000..e69de29 diff --git a/y2017/Cargo.toml b/y2017/Cargo.toml new file mode 100644 index 0000000..89e3e75 --- /dev/null +++ b/y2017/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "y2017" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/y2017/src/lib.rs b/y2017/src/lib.rs new file mode 100644 index 0000000..e69de29 diff --git a/y2018/Cargo.toml b/y2018/Cargo.toml new file mode 100644 index 0000000..8aa65cd --- /dev/null +++ b/y2018/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "y2018" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/y2018/src/lib.rs b/y2018/src/lib.rs new file mode 100644 index 0000000..e69de29 diff --git a/y2019/Cargo.toml b/y2019/Cargo.toml new file mode 100644 index 0000000..473fd68 --- /dev/null +++ b/y2019/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "y2019" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/y2019/src/lib.rs b/y2019/src/lib.rs new file mode 100644 index 0000000..e69de29 diff --git a/y2020/Cargo.toml b/y2020/Cargo.toml new file mode 100644 index 0000000..5bf656a --- /dev/null +++ b/y2020/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "y2020" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/y2020/src/lib.rs b/y2020/src/lib.rs new file mode 100644 index 0000000..e69de29 diff --git a/y2021/Cargo.toml b/y2021/Cargo.toml new file mode 100644 index 0000000..46924ea --- /dev/null +++ b/y2021/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "y2021" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/y2021/src/lib.rs b/y2021/src/lib.rs new file mode 100644 index 0000000..e69de29 diff --git a/y2022/Cargo.toml b/y2022/Cargo.toml new file mode 100644 index 0000000..c79c1a3 --- /dev/null +++ b/y2022/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "y2022" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/y2022/resources/1_input.txt b/y2022/resources/1_input.txt new file mode 100644 index 0000000..c87716d --- /dev/null +++ b/y2022/resources/1_input.txt @@ -0,0 +1,2239 @@ +5229 +1021 +2051 +4766 +2272 +5810 +4688 +2324 +2108 +1555 +1221 +4146 +5044 +2238 +4504 + +4800 +3333 +1171 +5362 +6213 +3200 +1185 +5839 +4075 +3956 +6688 +4293 +2244 + +6719 +2596 +5233 +5371 +4802 +5901 +6093 +2420 +2593 +4093 +1909 +3851 +4143 + +4353 +6425 +2546 +6368 +1939 +8550 +10505 +4718 + +16579 +11333 + +15453 +15172 +2678 +9202 +12549 + +2133 +16769 +6807 +10384 + +5130 + +5492 +2088 +4364 +2038 +4419 +7450 +3359 +6575 +1811 +1065 +3443 +6769 + +8085 +2908 +2192 +9586 +8144 +3625 +1113 +9057 +6255 + +1004 +3788 +1602 +1397 +7117 +5793 +4339 +7354 +5803 +2360 +6861 +1522 + +5499 +2694 +8448 +4969 +11138 +10227 +10473 + +4744 +8173 +8040 +3327 +2479 +1309 +5436 +6021 +4698 +7111 + +13459 +12831 +7358 +15243 +3310 + +7088 +4279 +7065 +6887 +3621 +4702 +1484 +4701 +3229 +3439 +5433 +4329 + +7427 +7116 +6640 +1625 +2075 +5473 +2507 +1544 +6361 +2094 +3899 +2610 + +6263 +5554 +6191 +6093 +5987 +2865 +5213 +1355 +4344 +5328 +6272 +3737 + +2399 +2336 +10098 +6547 +9483 +12974 + +1527 +3720 +2296 +2088 +4438 +6495 +6942 +4604 +4107 +3254 +1380 +5208 +5948 + +4000 +2423 +1105 +7756 +8917 +7394 +7770 +3422 +2047 + +67584 + +2065 +7562 +10516 +10553 +10862 +1649 +6791 + +23829 + +15750 +2204 +19115 +15870 + +7268 +5558 +5422 +5021 +8548 +5005 +6228 +7622 +2537 +8556 + +33525 +27002 + +22390 +18440 + +6424 +3180 +3370 +5910 +3600 +5372 +2190 +4435 +5612 +1747 +5186 +2234 +1362 +2488 + +10025 +6160 +11865 +10498 +8954 +11766 +9467 + +7958 +7431 +2598 +9243 +1023 + +5265 +7388 +19730 +14381 + +7462 +7931 +11405 +15307 +2299 + +13973 + +20066 +7931 +7988 +8215 + +3310 +3792 +8265 +9425 +8647 +6148 +7474 +1780 +2499 + +5298 +13922 +4072 +10671 +3101 +12829 + +16641 +22259 +1578 + +9335 +5856 +9672 +5600 +6443 +9070 +8995 +8084 +3434 + +4216 +5010 +11813 +20020 + +3295 +2690 +4680 +2403 +3001 +6708 +5748 +2355 +2128 +5044 +2099 +6000 + +3763 +6528 +10478 +4551 +9988 + +8569 +7005 +4566 +6513 +1950 +2148 +3186 +1171 +5245 +8244 + +5606 +5518 +1462 +5388 +5695 +5634 +1000 +2098 +4377 +2150 +6258 +1533 +6222 +3036 + +6084 +6129 +8881 +14255 +6495 + +66183 + +5564 +1009 +4149 +5793 +2266 +1705 + +5977 +22302 +9281 + +6193 +14000 +14745 +3014 + +5902 +17074 +11705 +9397 + +6884 +6107 +4079 +4218 +5741 +6422 +6436 +3614 +6461 +5772 +3100 +2299 + +1546 +1259 +1627 +12300 +4167 +3932 + +1885 +9182 +1952 +16058 +14592 + +16225 +16113 +10532 +4250 +11214 + +31877 +36104 + +5246 +5358 +11483 +11503 +5218 +9448 +7425 + +25508 +9115 +4944 + +9218 +2788 +6860 +7370 +7501 +6767 +7943 +2835 +9385 + +10446 +7768 +9449 +4090 +3771 +9608 +10677 +1005 + +2635 +2054 +1833 +5826 +6041 +4622 +1105 +5411 +1506 +1923 +6431 +1353 +5869 +1648 + +5704 +6247 +4503 +3083 +5779 +2804 +1199 +2892 +2739 +5607 +3526 + +2771 +5208 +3119 +1113 +3476 +4207 +5357 +2120 +3531 +5552 +1043 +3669 +1914 +3652 + +18512 +14761 +12199 +1376 + +6703 +4679 +7790 +4334 +4303 +5619 +2589 +3915 +2997 +6274 +4484 + +5025 +2456 +8912 +3731 +9568 +7868 +3151 +2172 +4352 + +2779 +7809 +3280 +7390 +4478 +7060 +4169 +7992 +8380 +8439 + +3143 +6816 +10122 +5685 +5170 +2059 +8293 +9561 + +3417 +4412 +1467 +1311 +6945 +3132 +5980 +6429 +3119 +2319 +7478 + +3223 +5320 +7368 +8486 +2951 +6262 +3176 +4165 +3878 + +2443 +4707 +1055 +6164 +1933 +5384 +2472 +4678 +1365 +6058 +5045 +3526 +2478 +6242 + +1286 +5592 +3943 +2235 +2166 +4402 +4203 +2419 +1191 +1985 +6481 +3031 +3699 +6274 + +2203 +2020 +7484 +7188 +6099 +4564 +5343 +2978 +1539 +3436 +1581 + +28968 +12842 + +4498 +2415 +5259 +3098 +1288 +4208 +5355 +4597 +4699 +1928 +5050 +2462 +1514 +5115 +1197 + +15417 +1105 +1468 +1358 + +1621 +2013 +7223 +7313 +2414 +6412 +2365 +7850 +5633 +8206 + +3811 +5927 +1159 +1085 +3270 +4467 +3219 +3170 +4662 +2590 +1022 +4492 +3701 +4735 + +6547 +15615 +1763 +8586 + +23698 +22840 +12561 + +6985 +4860 +12931 +16856 + +1083 +4957 +6887 +5155 +4573 +8668 +1336 +8058 +8624 +8116 + +6282 +1864 +4625 +2738 +3100 +3852 +6224 +2926 +3468 +5571 +1032 +2980 +2729 +1273 + +4675 +4413 +2779 +1618 +10546 +6725 +4553 + +15889 +13338 +16005 +4849 + +4016 +3798 +5876 +2734 +3833 +4346 +2636 +4337 +3190 +5733 +1979 +5696 +2727 +1418 +2574 + +8667 +4569 +7164 + +19076 +3353 +4646 +17303 + +7284 +3008 +3663 +5071 +3042 +4171 +1437 +5811 +6058 +5130 +4305 +1291 + +7413 +7982 +11370 +4943 +9583 +1901 + +1642 +7125 +2990 +7913 +11688 +2514 + +2868 +12143 +12040 +11711 + +8805 +1603 +1179 +13785 +8428 + +4162 +9190 +6700 +4467 +4947 +2815 +2319 + +64490 + +3013 +1415 +13338 +3331 +1361 + +26047 + +1780 +4104 +5757 +5818 +1251 +3359 +4210 +1382 +2507 +4818 +1130 +6357 +3442 +5819 + +10413 +8903 +6201 +3934 +12130 +8453 +10653 + +1684 +2348 +5795 +1420 +1533 +3313 +4634 +3107 +4626 +5932 +3543 +2424 +1944 +2915 + +8046 +5983 +4089 +3012 +1454 +5177 +5704 +5148 +3769 +4505 +5509 + +5484 +7059 +10998 +4037 +13095 +6590 + +1059 +1731 +6387 +7867 +5405 +7385 +4731 +5900 +7625 +4242 +5875 + +13584 +9147 +24719 + +7419 +3974 +4510 +6372 +1552 +1934 +3671 +6909 +6537 +2785 +4339 +3714 + +5596 +5725 +4532 +4762 +2518 +1155 +3972 +3028 +6432 +4100 +1883 +5287 +1470 + +3265 +1729 +3171 +2551 +4462 +4361 +4693 +1886 +4187 +4430 +2527 +2109 +6052 +5684 +2048 + +2469 +3613 +4172 +4836 +5713 +7756 +2870 +9449 +8116 + +2474 +7277 +6954 +4829 +4791 +6739 +5223 +5751 +6456 +7201 + +22678 +12732 +15221 + +3414 +4011 +6552 +4142 +3298 +2479 +4871 +6551 +3378 +4159 +2044 +1348 +4820 + +1720 +2185 +1264 +4074 +4456 +6572 +4805 +5381 +5202 +5656 +5154 +2408 +4344 + +1578 +2550 +3350 +3005 +3781 +5022 +6092 +2156 +3303 +1167 +6109 +4984 +5228 +4764 + +9527 +4255 +16366 +9609 +15617 + +1931 +4759 +4649 +1068 +5695 +2296 +4911 +3557 +2692 +5220 +2041 +3792 +1036 +1282 + +7735 +1541 +9568 +5770 +2422 +9918 +9230 + +4047 +2209 +1412 +2876 +5087 +4431 +3271 +4213 +3874 +1850 +2848 +3097 +1604 +6014 + +4123 +5797 +9239 +4185 +1985 +8496 +12133 + +5966 +3182 +3301 +3752 +3076 +5895 +4127 +1256 +2765 +5702 +1099 +2699 +1982 +3853 +2466 + +3231 +16587 +14341 +12450 + +3252 +5245 +7317 +3264 +1597 +7616 +7997 +6473 + +30334 +20535 + +3226 +1900 +1115 +2451 +2544 +1454 +4748 +2103 +1603 +4768 +4127 +6880 + +7664 +4890 +7471 +4256 +4500 +7972 +7735 +1608 +5403 +6407 +2323 + +16144 + +17580 +15361 +20625 + +3069 +4258 +9309 +4430 +3506 +5655 +2470 +2554 + +6720 +4729 +10030 +6668 +11714 +9766 + +5695 +3592 +2401 +6246 +6326 +3577 +7170 +2956 +7886 +5671 +4073 + +9308 +6580 +3406 +2614 +10222 +11738 + +5705 +5017 +7426 +5464 +7683 +7143 +1430 +3296 +5567 +1246 + +6068 +16761 +24717 + +8627 +4695 +3905 +9375 +2530 +2468 +8353 + +4233 +8937 +4755 +7728 +2911 +8201 + +11742 +9806 +9398 +5486 +3986 +3737 +4431 + +4521 +6395 +10148 +10058 +5169 +5924 +6215 +9839 + +3822 +3938 +3255 +5686 +4069 +1748 +5290 +1172 +4756 +5298 +1445 +1151 +1757 +4880 +1005 + +7801 +5402 +3736 +1269 +3067 +6793 +2603 +2757 +4267 +1098 +1487 + +2050 +2462 +3498 +1989 +2954 +5902 +1742 +5812 +1725 +3039 +4056 +3462 +2234 +4982 +4204 + +7154 +7180 +9175 +7523 +11486 + +2268 +14293 +3172 +13819 + +2565 +5565 +7335 +3609 +1350 +1829 +3223 +6861 +3201 +2821 +5546 + +27227 +6603 + +27999 +36577 + +1899 +5224 +1904 +4450 +4721 +3288 +2261 +1482 +5854 +1855 +3314 +1240 +2040 +5785 +1321 + +5636 +13866 +11081 +7189 +1212 +3350 + +1128 +4191 +5944 +5123 +1758 +3625 +4668 +4213 +2290 +5714 +3182 +3927 +1452 +1336 +3944 + +5180 +3316 +5766 +1930 +1360 +1494 +1686 +3687 +1163 +5291 +2004 +5156 +2966 +1079 +6110 + +16746 +12254 +6000 +5315 + +2494 +6563 +1214 +5120 +4184 +2958 +4187 +3182 +4165 +3772 +5885 + +2563 +9144 +13383 +2614 + +1967 +6950 +5760 +11165 +2977 +6822 +11217 + +4641 +3789 +3318 +7045 +2157 +5785 +2074 +4366 +6727 +5210 +1268 +7154 + +1050 +4906 +5598 +1917 +1037 +6393 +1109 +2455 +3396 +2416 +5997 +4541 +3292 +6169 + +3863 +4824 +3689 +1274 +5440 +2468 +3532 +3726 +2534 +1350 +5809 +2808 +5413 + +5625 +9547 +9049 +4953 +10529 +5656 +5423 +10330 + +3362 +3192 +1803 +10128 +10464 +6895 +7316 +6016 + +4023 +6108 +5742 +6475 +3507 +3644 +2447 +2746 +2025 +4809 +5356 + +5481 +5028 +3434 +2592 +2764 +4581 +5131 +6579 +3688 +3831 +2638 +6920 + +15426 +10544 +15670 +10196 +10450 + +3950 +1578 +7483 +6322 +6168 +5071 +1959 +6613 +2528 +1155 +6651 + +8933 +7371 +7241 +2825 +3312 +5629 +5569 +1476 +7875 + +6063 +8359 +8025 +7009 +2844 +5998 +2172 +5087 + +3012 +4589 +2428 +4325 +2476 +4431 +1084 +1870 +3717 +5620 +2078 +5550 +3696 +4003 + +12043 +10021 +12260 +11676 +1358 + +1906 +1415 +2453 +2656 +8867 +11861 + +2003 +8051 +3821 +5617 +4339 +3956 +1460 +3683 +3041 +1109 + +5108 +3195 +4262 +3074 +1153 +5069 +3090 +2216 +3822 +5849 +5349 +1722 +3544 + +3131 +7765 +5030 +7322 +4358 +3805 +6231 +4337 +6983 +8058 +1750 + +4404 +6696 +9425 +1185 +8939 +7995 + +20444 +12374 + +4697 +4969 +3703 +3355 +2636 +2864 +1906 +2337 +5805 +5042 +2531 +4525 +4332 +5240 +2334 + +2803 +7814 +21563 + +1134 +5051 +6097 +2678 +1589 +1077 +3220 +4583 +5404 +4625 +5550 +2604 +4208 +2707 +1403 + +31477 +25502 + +2395 +3341 +4197 +5847 +2087 +4219 +3782 +8698 +1857 +4450 + +6868 +1572 +3798 +4386 +2165 +5536 +3098 +4647 +2891 +3992 +1417 +4182 +2526 + +5524 +1679 +1359 +6686 +3481 +5993 +5716 +3492 +4518 +2286 +5154 +4729 +3745 + +2077 +1960 +2921 +5233 +6199 +5723 +3587 +2224 +2973 +4124 +2532 +5729 +2725 +2212 + +5547 +27031 + +2663 +4381 +2660 +3011 +1553 +4661 +4388 +4255 +4149 +5342 +1474 +1773 +1643 +4990 +2785 + +13510 +11941 +11601 +13234 +14555 + +3141 +1458 +2337 +1301 +3536 +3120 +5346 +3305 +1966 +1317 +1306 +5272 +2471 + +14739 + +1090 +4088 +3187 +6949 +3188 +4069 +1081 +1362 +4687 +4987 +6125 +4276 +5416 + +5420 +4661 +1134 +6794 +6879 + +3519 +10646 +11068 +7566 +1738 +4000 +6352 + +5828 +4345 +1475 +5378 +3732 +3484 +1380 +5713 +1288 +4980 +3355 +5957 +4201 +6060 +2319 + +1567 +6755 +4660 +5039 +2185 +5556 +1548 +6784 +7435 +8673 + +7674 +6663 +4682 +7994 +6190 +5627 +5437 +10249 + +6224 +6926 +3873 +8730 +3293 +5941 +4277 +3248 +6169 + +33991 +37153 + +10839 +17054 +2274 +16762 + +3539 +4987 +5992 +1987 +6262 +7251 +3518 +2978 +1940 +7579 +4792 + +15466 +17473 +11506 + +6225 +1583 +3381 +5832 +7437 +1738 +3851 +4062 +3985 +6128 +2106 +5395 + +11595 +11726 +4915 +6481 +10978 +11348 +6436 + +69359 + +7954 +6267 +7397 +2410 +3368 +2405 +2653 +10068 + +1229 +3516 +2863 +5960 +6461 +1208 +2495 +2725 +4777 +3103 +3609 +3455 +6118 +3885 + +10757 +17804 +13767 + +13854 +2648 +25818 + +8694 +4841 +3987 +11448 +12847 +2139 + +1320 +11876 +13686 +15670 +3638 + +11207 +5853 +16863 +6347 + +3506 +1460 +2170 +1558 +4391 +5749 +1559 +4347 +1848 +2377 +2287 +2061 +2944 +1859 +3770 + +1004 +4706 +2800 +5717 +1363 +4130 +2804 +4492 +5275 +6138 +1741 +4835 +1608 +2935 + +4281 +4949 +3882 +4723 +3772 +1715 +1966 +2851 +5124 +6875 +2605 +4571 +5076 + +5090 +1237 +4259 +2706 +2207 +3303 +6721 +5107 +5765 +3215 +5590 +1299 + +3633 +5271 +6428 +2905 +3439 +1169 +2324 +3467 +5839 +2215 +3825 +6168 +2515 +2639 + +4152 +3191 +7939 +2909 +7758 +8458 +10068 +3091 + +7840 +3473 +1536 +1749 +7930 +1987 +3695 +4027 +2904 +1083 +2398 + +1712 +3774 +3351 +2025 +2892 +3478 +3597 +4129 +2755 +3052 +1201 +1473 +4412 + +11300 +11432 +8714 +8717 +3686 +9938 + +2212 +6074 +1598 +1582 +4499 +6651 +4829 +1075 +2163 +3523 +3353 +6924 +5548 + +1300 +2708 +4287 +2338 +6756 +2542 +1000 +3609 +4850 +4073 +4370 +1536 + +8355 +10196 +9152 +7652 +6908 +10396 +1328 +2985 + +1636 +5454 +2321 +8639 +7510 +2116 +9825 +2967 + +7415 +5557 +6905 +7370 +5778 +2604 +5217 +7410 +3024 +1438 +6475 +4944 + +6302 +6308 +7719 +3740 +1278 +6259 +7667 +9084 +5198 + +2829 +4397 +3821 +4890 +2281 +3494 +6039 +5283 +3650 +2374 +5767 +5077 +3983 + +13986 + +4806 +1352 +6248 +6441 +2520 +2442 +4442 +4725 +1529 +4924 +3382 +6294 +2256 +4248 + +1914 +2192 +2583 +3469 +6484 +3053 +1601 +2778 +4338 +1295 +2052 +1196 +4080 +1226 + +5912 +5781 +4362 +4609 +6503 +6887 +6190 +6875 +5729 +2286 +6269 +3697 +6917 + +13964 +18073 +1619 + +5598 +4795 +3109 +1533 +4062 +1070 +5467 +1791 +1786 +1690 +5663 +5442 +4007 +5523 +3620 + +5587 +3778 +3342 +8950 +1061 +1562 +4896 + +22883 + +3218 +3454 +2771 +2855 +2949 +4683 +6479 +7767 +2638 +5846 +7089 + +9225 +6021 +7659 +9858 +9055 +1762 +10125 + +12693 +4685 +19506 +12078 + +6854 +5988 +5689 +3777 +1147 +7286 +6738 +1202 +4855 +5018 +6886 +6392 + +7804 +1729 +9762 + +1753 +2124 +1404 +6974 +5381 +7212 +3108 +8010 +3290 +4152 +6716 + +6101 +1846 +15812 +14339 +2432 + +2278 +5499 +4614 +4429 +3867 +2956 +3488 +6817 +1576 +6129 + +3185 +4667 +8304 +2137 +3003 +4787 +7451 +6037 +5938 +8541 + +58634 + +5507 +5347 +7888 +8768 +8159 +3449 +8288 +5246 + +1701 +1682 +4615 +2661 +3590 +8912 +10306 + +8832 +2882 +10016 +4781 +3901 +5466 +8481 + +6374 +3087 +7462 +2743 +7047 +7400 +5802 +4531 +5299 +1025 +1437 +5227 + +6500 +2359 +11048 +2806 +9293 +9680 +10283 + diff --git a/y2022/resources/2_input.txt b/y2022/resources/2_input.txt new file mode 100644 index 0000000..cc70403 --- /dev/null +++ b/y2022/resources/2_input.txt @@ -0,0 +1,2500 @@ +C Y +B Y +C Y +B X +B X +B X +C Y +B Z +A Z +A Z +A Z +A Y +A X +A Z +A X +A Z +C Y +A X +A Z +A Z +A Z +A Y +C Y +B Z +B Z +C Y +C Y +C Y +C Y +A X +B Z +C X +B X +A Y +C X +C Y +C Y +B X +C X +B Z +C Y +B X +C Y +B X +B X +C Y +A X +B X +B Z +B X +A Z +B Z +B X +B Y +C Y +A X +C Y +A Z +C Y +C Z +B Z +C Y +C Y +C Y +B Y +B X +B X +A X +B Z +B X +B X +B X +B X +B Y +B X +B X +B X +B X +B Z +B X +B X +B Y +B X +C Y +C Y +B Z +A Z +A X +B X +B X +A X +B X +A X +B X +A Z +B Y +A X +A Y +C Y +A X +A X +C Y +A Z +B X +B Y +C Z +C Y +B X +B X +A Z +B X +B X +C Y +A Z +A Z +B X +C X +B Z +C Y +B X +A Y +C Y +B Z +C Y +B Z +A X +C Y +C Z +B X +B X +C X +A X +B X +B Z +B Z +B Z +A Y +B Z +B X +C Y +B Z +A Z +C Y +C Y +A Z +C Y +B X +B X +C Y +B Z +B Z +C Y +A X +C Y +C Y +B X +B Y +C Y +C Y +A Z +B Z +B X +B X +C Z +C Y +A X +B Z +B Y +C Y +C Y +B X +B Z +C X +B X +C Y +B Z +A X +B X +B Z +A X +C Y +B X +B X +C Y +A X +B X +B Y +A X +A Y +C Y +C Y +B X +A Z +A X +B Y +A X +A X +C X +C Y +B Y +A Z +C X +A X +B Z +B X +B X +C Y +A X +C X +C Y +A X +C Y +B X +B X +C Y +C Y +B X +A X +B X +A X +C Y +B Y +B Z +B X +B X +C X +C Y +B Z +C Y +C Y +B X +A Z +B Z +A Z +A Z +C Y +B X +C Y +C Y +C X +B X +C X +C Z +C Y +B Z +C Z +C Y +A Z +B X +C X +B Y +B Z +C Y +B Z +B Z +B Z +A Z +C X +A Y +B Z +A Z +B Z +B Y +A Z +C Y +C Y +B X +A X +B X +C X +B Y +C Y +B Z +B X +C Y +A X +B Z +B Y +C X +C Y +B X +A Z +A Z +C Y +B Z +B Z +B X +B X +C X +B X +B X +B X +A Z +A X +C Z +B X +A Z +B X +C X +B X +C X +B Z +B X +B X +A X +B Z +B Y +A Z +A Z +C Y +C Y +A Z +A Z +B X +A X +B Z +C X +C Y +C Y +B Z +A X +B Y +B Z +A X +C Y +B Z +A X +B X +B X +C Y +C Z +A Y +A X +C Y +A Z +C X +A Z +A Z +C X +A X +A Z +B Z +A Y +A Z +C Y +B X +B X +B Z +B X +B X +B Y +B X +B X +C Y +B X +A Z +B X +C Y +A Z +B Z +C Y +C X +C Y +B X +C Y +B Y +B X +B Z +C Y +A X +A X +C X +B X +A X +C X +B Y +B Y +A Z +C Z +C Z +A X +C Y +A Y +A Z +B Z +A Z +A X +A Y +B X +B Y +C Y +A X +B Y +C X +C Y +B Z +C Y +A X +B Z +B Z +A X +C X +B X +A X +B Z +C Y +C Y +B Y +A Y +B X +B Z +B X +C Y +B X +C Y +C X +A Z +B Z +C Y +B X +B Z +B Z +B Z +C Y +C X +C X +B X +A X +C Y +C Y +B X +B Z +C Y +A X +B X +B Z +B Z +B Y +A Y +B X +B Z +B X +A X +A Z +A Z +C X +B Y +B Z +C Z +B X +C Y +B X +C Y +B Y +B Z +B Y +B X +A Z +C X +A X +A Z +C Y +B X +C Y +C Y +B X +C Z +B Z +B Z +C X +C Y +A Y +C Y +A Y +B X +B Y +A Z +B Z +B X +B X +A X +C Y +B Z +C Y +B X +A Z +B Z +C Y +B Z +A Z +C Y +B X +B X +C Y +C Y +C Y +B X +C Z +B Z +B X +C Y +C X +B X +C Y +B Y +B Z +B Z +B Y +B Z +B Y +A Z +B X +B X +A Z +C Z +A Z +B X +C Z +A X +B X +C Y +B Z +A Z +C Y +C Y +B Z +A X +C Y +A Z +B X +B Z +B Y +B X +B Z +B X +C Y +A X +B Z +C Y +B Z +B Z +C Y +B X +B X +A Y +C Y +B Z +B Z +B X +B Z +A X +A X +C Y +B X +C Y +A Z +A X +B X +C Y +B Z +A Z +B X +A X +B X +B Y +A X +C Z +A X +B Y +B X +A Y +C Y +A Z +B X +C Y +A X +B X +C Y +A Z +B Y +A Z +B Z +B X +A X +B Y +A X +A Z +B Z +B X +B Z +C Y +C Y +C Y +B X +B Y +A Z +A Z +B X +B X +B Y +A X +A Z +C Y +A Y +B Z +A X +C X +A Z +C X +C Y +C Y +B X +B X +B Z +A X +A Z +B Y +B Z +B X +B Z +B X +C Y +B X +C Y +C Y +B X +B X +C Z +C Y +A X +A Z +C Y +C Y +A X +A Z +A X +C Y +C Y +B X +A X +C Y +B X +B X +A Z +B X +A Z +A Z +C Y +C Y +B X +C Y +B X +A X +C Y +B Z +A X +C Y +B Z +A X +A Z +C Y +C Y +B X +A X +B X +B Z +A Z +C X +B Z +A X +B Z +C Y +B X +A Z +C X +B Z +A Z +A X +C Y +B X +C Y +B X +A Z +B Z +B X +C X +B Z +B Y +C Y +B Z +B Z +B Z +B Z +C Y +C Y +A Z +C Y +C Z +C Z +C Y +C Y +B Z +A Y +B X +A Y +B Z +A Z +C Z +B X +B X +C X +A Z +C Y +A Z +B X +B X +A X +B Z +B X +C X +A Z +B Y +A X +B X +A Z +A X +B Z +C Y +B X +B X +C Y +C Y +B X +A Y +C X +B X +C X +B Y +B X +C Y +C Y +B X +A Z +A Z +A Y +B Z +B Z +B Z +C Y +A X +B X +C Y +C Y +A X +C Y +A Z +B X +A X +A Y +B Z +B Y +B Y +C X +A Z +A Z +B Z +A Z +B Z +B X +A Z +B Z +B Y +B X +B X +B X +A Y +A X +B X +B X +A X +C Y +B Z +C Y +B Y +A X +B Z +A Z +C Y +A X +C Y +B X +B Z +B Z +C Y +B Z +C Y +B X +C Y +A Z +A X +B X +C Y +A X +A X +C Y +C X +C Y +A Z +B Z +A X +C X +C X +C Y +B X +C X +A X +C Y +B Y +A X +C Y +B X +A Z +C Y +C Y +A X +A X +B X +B Y +B Y +A Y +A X +C Y +A X +C X +B X +C Y +C Y +A X +A Z +B Z +B Z +C Y +B Z +B Y +A X +C X +C X +A X +C Y +B Z +A Z +B X +C Y +C Y +C X +C Y +C X +A X +C Y +B X +C X +B X +A Z +B Z +B Z +B Z +B X +B Z +B X +B Y +C Y +C X +A Y +B Z +B Y +C Y +B Z +A X +A X +A Z +C Y +A X +C X +C Y +B Y +B X +B X +A X +B Y +C Y +B X +C X +C X +A Z +A Z +C Y +B X +B Z +C Y +B Z +B Z +C Y +C X +A X +B Z +C Y +C Y +C Y +B Z +B X +C Y +B Z +A X +B X +C Y +A Z +C Y +A Z +A Z +B Z +C Y +A Z +C Y +B X +A X +A X +B Z +C Y +B Y +B X +A Z +B X +C Y +A Z +C Y +A X +A Z +B X +B X +B Y +B X +A Z +C Y +A X +C Y +C Y +C Y +C Z +C Y +A Z +A Y +B Z +C Y +B X +C Y +C Y +A Z +C Z +C Y +B X +C Y +A Z +B Z +B Y +B Z +A Z +B X +B X +C X +B X +B Z +A X +C Y +C Y +C Y +A Z +B X +B Y +A X +A Z +C Y +A Z +A Z +B X +C Y +B Z +B Z +B X +C X +A Z +C X +B Z +C Y +A Z +B X +C Y +B X +A X +C Z +C X +C Y +A Z +C Y +B X +B X +B X +B X +B X +A Y +C Y +B X +A X +A Z +A Z +A X +C Z +B Z +C Y +B X +B Z +A X +B X +B X +C Y +B X +C Y +A Z +A Z +C X +B Z +A X +C Y +B X +C Y +C Y +C Y +B X +B Y +A Z +C Y +C Y +A X +A X +C Y +B X +B Z +C Y +A X +C Z +B Z +B X +C Y +C Y +B Z +A X +A Z +B X +C Y +A Z +A X +A Y +C Y +B X +B Z +A X +B Z +B Z +C Y +C Y +C X +B Z +A X +C Y +B Y +A Z +B X +B Y +B X +C Y +A Z +B X +A Z +C Y +B X +B X +C Y +B Y +C Y +C Y +C Y +B X +A X +C Y +C Y +C Y +A Z +C Y +B X +B X +B X +B X +A X +B Y +C X +B X +C X +A X +C X +C Y +A X +A Z +C Y +B Z +B Y +A X +B Y +C Y +C Y +B X +A X +A X +C X +B Z +C Y +C Y +A Z +B Z +B Z +C X +C Y +B X +B X +B Z +A Z +C Y +C Y +A Z +A Z +B X +B X +B Y +B Z +B Z +A Y +B Z +A Z +B Z +B X +B Z +C Z +B Z +A Z +B Z +B X +B X +B X +A X +C Y +A Z +C Y +C Y +B X +A Z +C X +B Z +B Y +C Z +B X +C Y +A X +C Y +A Y +B Z +C Y +C Y +B X +B X +A Z +C X +A X +A Z +B Y +C Y +C Y +C Y +B X +C Y +C Y +A Z +B X +A Z +C X +C Y +B Z +B Z +B Z +A Z +C Y +C Z +B Z +C Y +C Y +C Y +B X +B X +C Y +C Y +B X +A X +A Z +B X +C Y +B X +A Z +C Y +C Y +B Y +A X +A X +A X +A X +B X +B Y +C Y +A Z +B Y +B Z +A X +B X +C Y +A Y +C Y +A Z +B X +B Z +B Z +A Y +B X +B X +C Y +A Z +A Z +A X +A X +B Z +C Y +B Z +C X +A Z +C Y +B Z +C Y +C Y +B Z +A Z +C Y +C X +A Z +C Y +B X +A Y +A X +B Z +A Y +A Z +B X +C X +B Z +C Y +C Y +B Y +B Z +A X +B X +A Z +C Y +C Y +A Z +A Z +B X +C Y +B Z +A X +A X +B X +B Y +C Y +B X +C X +C Y +B Z +A Z +A Y +B X +C Y +C Y +C X +A Z +C Z +B Z +B X +A Z +A X +A X +B Z +B X +A Z +B Z +C Y +A X +B Z +B Z +C Y +C Y +A X +B X +C Y +A X +B X +C Y +B X +A Z +A X +B Z +A Z +B Z +B Y +A X +B Z +A Z +A Z +A Z +A X +A X +B X +B X +A Z +B Y +A Y +C Y +B X +C Y +B Y +C Y +A Z +A Z +B X +B X +C Y +B Z +C Y +B Z +B X +B X +B X +B X +A X +B Y +B X +C X +A Z +A Z +B X +C Y +C Y +C Y +A X +C Y +C Y +C Y +A X +C Y +C X +B X +A Y +C Z +C Y +A Z +B X +A Z +A X +B X +A X +A X +C Y +A Y +A X +B X +A Z +B Z +B Y +C Z +B X +A Z +C Y +B Z +B X +C Y +C Y +C Y +B X +A X +A Z +B X +A X +C Y +B Z +A X +C Y +C Y +A X +A X +A X +A Y +C Y +C Y +C Y +C Z +C Y +A X +B X +C Y +C Y +C Y +C Y +A X +B Z +A X +B X +C Y +B Z +A Z +C Y +A Z +C Y +B X +B X +C Y +C Y +B Y +A X +C Y +C X +C Y +C X +A Z +A Z +B Y +A X +A X +B Z +A Z +A X +A Z +C Y +A X +B Z +C X +A X +A X +B X +A X +B Y +A X +B X +B X +C Y +C X +B X +B Y +C X +A Z +B Z +B X +C Y +B Y +B Z +C Y +A X +C Y +B X +B X +C Y +C Z +B X +B X +C X +B Y +B Y +B Z +C X +B X +C Y +B X +C Y +B X +A X +A Y +B X +B X +B X +B Y +C Y +B X +B X +B X +C Y +A Z +B Z +B X +A Z +B X +B Y +C X +A Z +C Y +C Y +B Z +B X +C Y +C Y +C Y +C Y +B Z +A X +C Y +C Y +A Z +B X +B Z +A Y +C Y +B X +C Z +A Z +B Y +A Y +A Z +A Z +B X +B X +C X +A Z +B Z +A X +B Z +A Z +B X +B X +C Y +B Z +C Y +A Z +B Z +B X +A Z +C Y +B X +B Y +B Z +C Y +B X +C Y +B X +A X +A X +C Y +B X +B X +A Y +A Z +A Z +B Z +A Z +C Y +C Y +A Z +A X +A Z +B X +C Y +C X +A Z +A X +B Z +B Z +A X +B X +C X +C Y +C Y +B Z +B X +C Y +C Z +B Y +C Y +A Z +B Z +B Z +B X +B X +C Y +B X +B X +C X +A X +B Z +C Y +B Y +B X +A Z +B Z +B X +A Z +B Z +B X +A Z +B X +C Y +C X +B Y +B Y +B Z +C Y +A X +B Z +B Y +C Y +A X +B Z +B Z +C X +B X +C Y +C Y +C Y +C Y +A Z +A Z +B X +B X +C Z +B X +B Z +B X +B Z +A Z +B X +C Y +B X +C Y +C Y +A X +B X +A X +C X +B X +B Y +A X +B Z +A Z +B Y +B Z +C Y +B Z +C Y +B X +B Z +B Y +B X +B X +A Z +B Z +B X +A Z +C Y +C Y +A Z +A X +C Z +A X +B Z +B Z +C Y +B X +B X +A Y +B Z +C X +C Y +C Y +C Y +A Y +A X +B X +B Z +A Z +B X +C X +C X +C Y +C Y +C Y +B X +B X +A Z +B Z +B X +A X +A Z +C Z +B Z +B Z +B X +A X +B X +C Y +B Z +A X +B Y +B Z +B Y +B X +A X +B Z +C Y +C X +C Y +A Z +B Z +B X +B Z +B X +A Y +B X +A Z +B X +C X +A X +C Y +B X +C Y +C Y +A Y +C Z +A Z +C X +B X +C Y +A Z +B X +B Z +B Z +C Y +A X +A Z +B X +B X +B Z +B X +C Y +B X +A X +A X +C Y +A Z +C Y +B Y +B Z +B Z +C Y +B Z +C Y +B X +B X +B Y +C Y +A X +A Z +A Z +A X +C Y +B X +B Y +B Y +B X +A X +A Y +B Y +B Y +C Y +A X +B Z +C Y +A Z +C Y +B Y +A X +B X +A X +B X +A Z +C Y +C Y +A X +B Y +B Y +B X +A Z +A Z +A Z +A Y +B Z +C X +B X +C Y +C Z +B Y +C Y +C X +B X +B Z +B Z +B Z +B Z +B Y +B Z +A Z +C X +B X +C Y +C Y +B Z +C Y +C Y +A X +C X +A X +B Z +C Y +B X +C Y +A X +A Z +C Z +A X +B Z +C Y +C Y +C Y +A X +C Y +C Y +B X +B X +B Y +C Y +B Z +B X +C Y +A Z +C X +A Z +C Y +A Z +A X +B Z +B X +C Z +B X +C Y +A Z +C Y +B X +B X +B X +B Z +C Y +B X +A Z +A Z +C Y +B Y +C Y +B Z +A Z +A X +B Z +B X +B X +A Y +B X +B X +C Y +B X +B X +B Z +C Y +B X +A X +A Z +A Z +C X +A X +A X +B X +B X +B Z +A X +C Y +B X +C Y +C Y +A X +B X +A X +A Z +A Z +C Y +B X +C Y +B Y +B X +B X +C X +B X +A X +C X +B Z +C Y +B Z +B X +C Y +C Y +A Z +C Y +B Z +B X +A Z +C Y +C Y +B X +B Z +A X +B X +C Y +C Y +C Y +A X +A X +A X +B Z +B Z +A X +A X +B X +B Z +C Y +C Y +B Z +A Z +C Y +C Y +A Z +B Z +C Y +B X +B X +B X +C Y +C Y +B Z +C Y +B Z +A X +A X +B X +C Y +A X +A X +C X +A Y +C X +B X +B X +B Z +B Z +B Z +B X +B Z +C Y +C Y +C X +A Z +B X +A X +B Z +B X +A Z +C Y +B X +B Y +B Z +A Z +B X +A Y +C X +B X +C Z +C Y +B Z +A X +B Z +B Z +A X +B Z +B X +C Y +B Z +C X +C Y +A Z +C Y +A Y +B Z +B X +B Y +A Z +A Y +A X +B Y +A Z +B Z +C Y +C Y +C X +C Y +C Y +B X +B Z +A Z +B Z +B Z +A Z +C Y +A Z +C X +C Y +C Y +C Y +A X +C Y +B Z +A X +C Y +C Y +C Y +B X +B Z +B Y +C Y +C Y +C Y +C Y +B Y +A Y +B Z +B X +A X +A Y +C Y +C X +B X +B Z +A Z +B Z +B X +A X +C Z +C X +B Z +C Y +A X +C X +B Z +B X +B X +A Z +B X +B Z +B Y +C Y +B X +A X +B X +B Z +A X +B Z +A Y +C Y +A X +C X +B X +B Y +B Z +B X +B X +C Y +B X +B X +C Y +B Y +B Z +B Y +B Z +C Y +A Z +C Y +A Z +B X +B X +A Z +B X +C Y +C X +C Y +B Y +C Y +C Y +C Z +C Y +A Y +C Y +B X +B Z +A Y +B Z +A Z +B Z +B Z +B X +B Y +C Y +B X +C Y +C Z +C Y +A X +B X +B X +C Z +A Z +B X +A Z +C Y +B Z +B Z +B Y +A Z +B Z +C Y +C Y +A Z +C Y +B Y +C Y +B Z +C X +B Z +B X +A Z +B Y +B Y +B Z +A Z +B Z +C X +C X +B Z +B X +C Y +B X +A X +B X +B X +B Z +C Y +A Z +A Y +B Z +C Y +A X +A X +A Y +B X +B Z +A X +B X +C X +B X +B Y +B X +A Z +C Y +A X +C Y +A X +C Y +C Y +B Y +C Y +B X +C Y +C Y +B X +B Z +A X +C Y +C X +C X +C Y +B Y +A Z +C Y +A X +A X +B X +B X +A X +B X +C X +B Z +B X +A X +A Z +B X +C Y +C Y +A X +C X +B Z +B Z +B X +C Y +C Y +A Z +C X +B Z +C Y +B Y +A Z +B Z +A Z +B X +C X +C Z +C Y +A Z +B Z +B X +C Y +C Y +C X +C Y +C Y +C Y +A X +A Z +C Y +B X +B X +B Z +A Z +C Y +B X +A Z +C Y +C Y +B Z +A X +B Z +B Z +B X +B Z +B X +B X +B Z +B Z +C Y +A X +A X +A Z +C Y +C Y +B X +B Z +C Z +B X +C Z +C Y +C X +C Y +B Y +A X +B Z +A Z +C X +B X +C X +A Z +A Y +B Z +A X +A X +A Z +A Z +B Y +B Z +C Y +B X +C Y +B Z +B X +C Y +C Y +A X +A Z +B X +C Y +B X +B X +A X +A Z +B X +B X +B Z +A X +A X +B Z +B X +B X +B X +A Z +C X +B X +B X +B X +B Z +B X +C X +C Y +A Z +C X +A Z +C Y +A X +C Y +A X +B X +A Z +B X +C Y +C Y +A Z +A Z +B Z +B Z +B X +C X +A X +B Y +B Z +C Y +B Z +A X +A X +B X +A X +A X +A X +A X +B Z +B Y +C Y +A Z +C Z +C Y +A X +B Y +C X +A Z +B X +B Z +A X +A X +C Y +B X +B X +A X +A Z +C Y +C Y +A Z +C Y +B X +B X +A Z +A Y +C Y +A Z +A X +C Y +B Z +B Z +C Y +B X +C Y +C Y +C Y +C Z +B X +C Y +C X +B Z +A Z +C Y +A Z +B Z +A Z +B X +A X +A Z +B Z +B Z +A X +B Z +A X +B X +A Z +B X +B X +A Z +C Y +B X +B Z +C Y +B Z +B Z +B X +B Z +B X +B X +C Y +B X +B Y +B X +B X +A Z +B X +C Y +B X +B X +B X +B Z +A Z +B Y +B X +B Z +C X +C Y +B X +B Y +C Y +B X +C X +B X +C X +B Z +A Y +A Z +B Z +B Z +A X +A Z +B Z +B X +A Z +B Z +C Y +C Z +C Y +A Z +C Z +A Z +C Z +C Y +A Z +A Y +C Y diff --git a/y2022/resources/3_input.txt b/y2022/resources/3_input.txt new file mode 100644 index 0000000..cb4dee4 --- /dev/null +++ b/y2022/resources/3_input.txt @@ -0,0 +1,300 @@ +rNZNWvMZZmDDmwqNdZrWTqhJMhhgzggBhzBJBchQzzJJ +pHlSVbVbFHgHBzzhQHqg +nVsqGpbbtDtTNmrmfZ +zrBMnbzBchshsttfbMRBgmJggmmCHGgDhDgNDGHL +VddZqQqdvSQMJHJGdCDCDDmH +pZWWllPQlPZQvZvwpSVlqlvtfswMRzBbntzRbzbfstsRzF +NnjjRlnWNSWWbGwccbcchfPfTvfjfTBBpvmdMjTfvB +FVzJtDDJDqTMlmlM +gVQZlFLlzHhLGShGww +rPZtvtFrFPgWjQvCBlcqMzlqQC +QGVDJJnLnVTCJBczqqTM +fNSSnmLDSVLhhhSNSLhGSGfVPjrFHwmQwtwWFRWRjWPHrwgt +SvmlrVrCvmNhSSVZVCrsgqPfbwGFwwwsflbbGb +QHffdnHDDQdMGbgqPwztdPds +DjBjWHfQDfTQWTBfpMBQLVmmmcCCcVhCBBBhhCmC +trLHFFQHTLHJQrflfCnLLHrRfRRPqSRPbPbbsRGqqGqhjj +mcMpNWVVNmNVsSbSJPcGhPRR +NpzNgwzZDVNZVWNpHJQLQHtQrZQHrBCl +JVCMfgJVrJtMBhhrfVVfhVsjvpFGFgjSSgFdSGGqjvjvqF +mHllHlHpmWlDSFqbdSTS +nmZRLzQnWVpctMVpQs +BrvRzWBPWbRwGRjbbRGrtrfqjCJCjCJgJsZJscFCZcJC +MnnnVMVhTMQhsccVfwqFJgqf +mMShHHppQmHrrBzwtSbWwR +pWWGJMJJwlnZSqjWmvSWZC +gtHrLttDtgFjjqRZZCrjpp +bFtbTpHFHLbfLFbHVttccttddJGQdJzTwdTzJlMnMBwwJJ +JhqHFhVMzJPQcdcVncdc +NhgfwSjwCWwltSfnrnRWZdpcPrrRnp +NNhlltBjssNBgwLFFvDmD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vLLQDSGlRmmSLjlDmRQggFBrMCwWdsBFWBFjdrrWrr +PpTfcPZpNTVNpHzTzzzpPJhBcwrrhFsrMdFcMCBFhgMF +JTTqdtfzfzJpqffNdTTHGtQRnmDQGGLQQlQRbblD +CQQCshCMwgQhMdjWJFBPpbjgmmWj +SNNvcGNSZSTDtGDcczJJBmzbjBJjmppbppms +cDtfDVNTGGGNNrwLLwHdqLhfLs +ngghZCChzhNjjNbbJfdh +slPPRLlBBlVRMvRllLLHvcpcdFfJjvdFpfHfcZ +RDZPZBLmPVWDVrQtnzSTmgTwmTSg diff --git a/y2022/resources/4_input.txt b/y2022/resources/4_input.txt new file mode 100644 index 0000000..bcf9e87 --- /dev/null +++ b/y2022/resources/4_input.txt @@ -0,0 +1,1000 @@ +2-5,15-90 +42-93,43-57 +71-95,72-81 +19-92,2-93 +21-92,57-93 +57-75,76-76 +66-92,14-76 +4-97,5-96 +22-50,22-51 +10-43,42-43 +50-59,60-60 +81-86,86-94 +86-98,82-99 +44-63,44-62 +36-65,42-89 +2-86,14-85 +51-51,48-52 +41-55,10-55 +3-99,3-96 +62-64,38-63 +24-80,80-98 +13-67,7-47 +22-78,21-91 +3-92,26-91 +97-98,86-98 +17-90,16-91 +4-96,97-97 +33-46,44-47 +98-98,44-96 +9-36,7-13 +17-91,18-90 +1-37,4-37 +19-58,18-58 +42-43,11-42 +9-98,10-97 +6-22,5-6 +9-12,13-61 +4-16,17-24 +37-45,36-38 +62-86,61-61 +8-41,8-40 +35-91,35-98 +84-85,72-84 +40-90,41-91 +47-58,31-59 +30-80,22-31 +87-89,58-90 +13-25,14-25 +23-54,52-53 +4-89,5-88 +3-99,1-2 +4-54,3-53 +4-33,5-52 +50-92,49-50 +72-98,71-97 +7-27,26-27 +10-49,39-78 +3-93,16-92 +16-30,31-96 +6-90,5-6 +5-93,4-99 +7-99,8-95 +49-89,50-90 +43-43,38-42 +23-78,6-79 +89-90,31-89 +3-8,7-25 +26-54,26-27 +64-87,64-97 +25-53,25-53 +17-77,17-78 +58-88,59-82 +7-30,6-29 +9-95,1-10 +31-98,26-97 +3-9,10-55 +19-19,19-35 +81-86,22-86 +51-69,52-70 +17-82,17-82 +30-41,30-52 +32-36,17-34 +12-60,15-61 +5-85,6-86 +26-95,25-95 +2-94,94-95 +37-37,38-76 +39-59,38-38 +8-98,7-97 +15-95,14-94 +63-65,27-64 +18-62,61-61 +8-82,8-82 +75-75,74-75 +63-98,63-98 +68-86,12-69 +41-88,53-91 +18-81,94-94 +67-99,66-67 +41-42,42-50 +39-40,4-39 +11-12,12-20 +43-48,40-49 +10-10,11-49 +8-50,8-49 +42-42,43-94 +30-94,6-32 +15-92,15-15 +4-88,1-40 +5-13,11-15 +5-76,1-6 +1-3,3-92 +6-92,9-91 +74-98,73-99 +10-13,13-35 +26-81,27-82 +13-69,12-93 +6-44,6-43 +22-88,88-89 +48-58,47-71 +23-24,22-24 +2-47,7-42 +28-55,27-56 +20-93,93-93 +61-76,26-60 +63-98,63-97 +26-29,25-30 +69-79,9-69 +18-98,17-97 +51-59,50-51 +2-98,3-97 +26-92,11-26 +15-20,26-89 +18-42,41-41 +1-95,1-96 +9-98,97-97 +99-99,3-99 +3-99,3-96 +3-70,3-71 +14-65,14-39 +2-96,97-99 +21-58,22-57 +7-64,35-63 +4-83,83-83 +23-74,75-99 +98-98,1-99 +38-94,38-94 +65-77,78-78 +12-50,49-49 +32-84,84-85 +9-35,9-35 +11-50,39-51 +7-98,9-96 +30-57,29-56 +61-69,25-61 +7-81,17-82 +5-35,35-35 +11-79,12-78 +35-76,35-77 +25-36,19-36 +79-92,37-91 +4-4,3-97 +10-12,15-30 +36-64,37-63 +11-14,13-83 +13-82,92-96 +6-6,16-71 +17-75,10-29 +25-74,25-73 +67-92,59-91 +81-83,64-82 +88-88,37-87 +45-76,36-52 +2-13,12-92 +24-25,25-31 +5-95,1-4 +11-55,4-10 +32-91,32-90 +77-77,11-77 +20-64,20-63 +45-63,49-62 +20-99,19-91 +13-67,5-14 +29-49,24-40 +12-67,12-68 +98-98,5-99 +28-51,52-56 +2-99,38-99 +17-50,16-16 +8-84,9-85 +67-92,26-67 +68-69,69-70 +18-54,19-19 +2-93,3-80 +2-28,27-42 +47-81,37-48 +25-35,34-35 +26-94,16-20 +26-92,27-93 +46-92,4-47 +91-91,18-91 +24-48,35-56 +5-94,5-94 +84-95,46-83 +5-95,95-97 +91-93,18-92 +15-46,16-47 +3-33,4-34 +4-91,4-71 +14-27,15-92 +71-92,92-92 +18-70,19-71 +46-68,47-69 +30-31,29-83 +28-89,29-98 +11-90,12-95 +65-70,28-68 +23-77,70-76 +21-44,45-90 +50-50,1-49 +60-94,61-93 +24-89,23-72 +15-93,3-16 +12-78,11-77 +11-20,68-92 +51-86,52-63 +29-41,29-29 +6-96,5-95 +45-91,44-90 +23-26,22-27 +7-82,7-82 +47-61,48-93 +7-7,8-88 +31-73,30-46 +22-85,22-86 +8-17,18-62 +10-77,11-77 +15-94,14-93 +5-78,2-2 +24-53,23-52 +61-79,62-80 +97-98,59-97 +69-99,34-58 +2-93,1-94 +88-88,89-99 +15-15,14-16 +20-20,21-25 +40-60,15-61 +18-25,84-86 +8-99,56-97 +12-98,6-49 +1-48,2-47 +34-44,33-43 +68-94,67-95 +3-56,23-56 +12-35,12-33 +23-79,24-43 +13-92,13-92 +60-96,29-97 +17-87,2-17 +29-61,43-61 +51-93,82-93 +19-95,19-94 +13-14,14-81 +19-19,20-40 +31-93,31-93 +9-94,8-93 +46-85,46-99 +5-51,6-52 +53-80,52-53 +7-57,39-59 +79-90,90-90 +72-93,26-69 +1-97,1-96 +18-79,18-50 +72-72,42-71 +54-95,54-99 +86-94,34-93 +20-77,21-77 +88-90,26-89 +23-83,23-84 +7-7,7-40 +35-35,18-36 +67-85,68-86 +22-59,21-58 +28-72,27-32 +13-13,1-12 +9-90,9-89 +24-69,25-70 +67-67,40-68 +1-9,15-96 +7-48,6-47 +36-67,48-54 +2-4,10-95 +4-89,15-97 +28-63,34-48 +81-81,80-80 +18-87,87-88 +94-94,8-95 +77-92,71-97 +41-41,42-90 +3-36,4-35 +3-91,96-96 +89-91,9-35 +1-82,1-1 +15-83,15-82 +4-92,4-93 +93-94,32-93 +82-93,96-99 +15-32,15-39 +60-64,59-65 +68-72,72-73 +65-72,27-64 +16-17,17-35 +7-19,7-67 +31-98,30-94 +93-99,30-96 +18-88,18-85 +18-45,17-77 +4-45,4-44 +74-82,40-73 +8-92,7-7 +18-86,86-86 +30-60,30-50 +42-78,39-78 +10-79,44-78 +8-96,8-39 +8-64,13-65 +92-93,30-92 +4-94,1-2 +91-97,92-98 +41-97,42-97 +2-97,2-70 +28-79,5-79 +30-30,31-68 +6-97,99-99 +10-10,9-20 +3-96,2-94 +3-8,8-47 +99-99,52-99 +2-31,1-6 +2-89,2-82 +22-95,29-94 +92-94,27-93 +1-2,2-87 +53-54,53-54 +1-66,41-62 +7-42,1-26 +7-98,8-97 +26-99,26-92 +2-95,3-94 +93-93,12-94 +21-23,9-22 +43-97,43-96 +45-72,74-83 +26-94,25-93 +32-32,31-71 +21-21,20-98 +4-98,26-98 +8-63,62-88 +2-82,6-97 +11-48,10-53 +54-54,55-93 +38-39,3-38 +75-77,74-76 +35-98,8-35 +13-83,84-97 +13-21,7-21 +2-17,16-78 +79-79,21-79 +25-87,87-88 +53-90,89-90 +11-38,37-37 +4-42,41-41 +2-2,3-98 +52-72,52-71 +16-22,13-21 +16-91,2-7 +4-61,29-46 +10-91,1-59 +28-93,27-93 +88-99,27-89 +27-87,88-88 +10-66,10-67 +12-13,12-42 +80-89,81-91 +39-85,39-84 +82-82,83-97 +24-46,47-63 +26-74,27-73 +4-92,2-3 +1-88,1-88 +29-94,29-68 +29-96,28-82 +51-51,52-80 +13-41,12-26 +3-51,17-50 +17-46,45-45 +16-25,97-99 +20-42,26-47 +21-49,40-44 +6-80,1-31 +74-86,68-85 +32-98,1-99 +7-30,6-30 +70-79,24-71 +64-97,28-49 +23-93,24-94 +29-42,28-28 +91-95,91-96 +9-41,10-40 +83-93,31-94 +42-94,41-76 +75-77,9-76 +64-93,92-93 +68-68,69-69 +14-21,19-20 +89-89,4-90 +8-10,9-59 +20-83,10-86 +37-89,38-88 +8-99,5-8 +8-50,20-49 +50-74,49-50 +20-92,19-93 +52-78,36-53 +63-96,62-63 +15-47,16-46 +87-88,4-88 +45-66,44-67 +49-54,48-94 +27-35,28-35 +67-91,66-90 +2-99,1-60 +16-85,15-84 +9-93,92-95 +4-38,37-39 +7-16,3-16 +33-41,33-67 +19-34,33-34 +79-85,85-86 +68-99,80-89 +4-70,11-81 +19-80,19-19 +15-64,63-64 +17-50,18-54 +14-87,13-13 +51-89,52-98 +73-90,12-91 +30-93,2-94 +80-81,8-81 +51-80,81-87 +75-83,97-97 +13-89,14-27 +1-2,3-46 +93-94,54-93 +11-84,11-85 +17-30,2-6 +15-65,64-69 +64-74,10-69 +9-95,10-94 +70-91,69-92 +27-96,26-95 +39-48,8-10 +46-49,45-46 +54-82,35-54 +1-1,2-86 +81-93,10-80 +88-93,42-93 +33-33,33-82 +9-55,56-73 +1-93,2-92 +97-97,2-95 +1-94,71-94 +26-54,59-66 +35-86,15-36 +2-55,4-66 +50-87,26-49 +43-87,19-43 +4-96,3-97 +20-90,53-89 +16-88,4-87 +64-64,11-63 +38-65,39-39 +11-31,12-32 +25-60,24-43 +24-47,26-48 +3-92,91-91 +87-95,87-90 +91-92,4-91 +74-77,74-76 +2-96,96-99 +26-42,26-59 +4-5,7-65 +64-71,44-64 +33-83,29-82 +19-32,18-28 +2-95,1-95 +28-95,28-95 +9-72,10-73 +50-96,96-97 +19-52,19-60 +9-78,8-9 +53-54,2-53 +36-86,4-37 +47-60,59-60 +80-81,43-81 +21-60,22-61 +27-78,26-77 +57-93,57-94 +1-92,95-96 +12-94,11-93 +4-99,1-47 +28-28,29-92 +34-86,54-87 +62-81,63-80 +13-98,97-99 +30-30,29-55 +29-72,29-94 +4-98,4-4 +48-50,49-49 +12-12,3-13 +42-91,41-91 +59-63,60-64 +6-61,7-54 +23-94,15-24 +6-98,6-97 +21-96,20-21 +18-68,18-68 +27-40,27-27 +16-99,3-17 +67-82,32-51 +98-98,26-77 +29-96,96-97 +3-31,1-32 +52-60,18-55 +6-88,5-95 +84-90,84-86 +19-83,18-97 +1-50,49-51 +94-94,23-95 +40-40,5-40 +29-30,29-29 +13-49,12-50 +28-76,27-75 +40-55,40-57 +9-9,10-98 +6-75,4-4 +4-95,5-96 +46-47,31-47 +44-62,43-61 +29-75,18-95 +37-72,37-73 +49-67,49-66 +55-78,56-79 +9-54,53-55 +3-65,4-64 +37-37,4-37 +29-55,30-56 +6-95,4-96 +78-80,79-81 +15-59,14-15 +61-62,55-62 +50-96,17-32 +12-96,11-96 +9-9,10-33 +36-89,97-99 +37-59,38-58 +32-51,33-54 +72-74,39-73 +77-99,77-94 +5-31,28-29 +22-96,21-21 +2-94,3-95 +6-97,6-98 +53-69,44-52 +29-90,30-91 +4-26,7-24 +18-26,27-91 +20-96,19-97 +22-28,23-27 +18-74,17-90 +36-70,36-94 +57-77,20-58 +10-36,11-80 +23-23,23-99 +7-87,88-88 +12-13,13-62 +4-38,2-5 +53-55,2-54 +30-87,4-87 +33-34,34-51 +86-90,39-86 +51-51,52-89 +7-42,8-8 +31-34,17-35 +4-77,33-78 +9-33,14-82 +39-83,40-82 +15-72,26-72 +77-93,92-92 +14-81,80-81 +81-96,97-97 +27-28,28-86 +50-83,37-50 +67-96,67-98 +23-91,23-91 +25-83,24-84 +43-82,43-48 +88-88,37-88 +97-98,2-96 +9-98,97-97 +20-33,20-33 +9-26,15-99 +1-4,3-61 +42-75,67-75 +29-94,29-60 +70-70,70-89 +1-92,1-92 +53-74,73-75 +80-80,2-81 +1-98,3-99 +1-92,3-91 +15-88,16-89 +7-97,8-96 +2-5,5-66 +3-83,2-82 +45-94,45-45 +20-26,26-92 +2-47,47-52 +31-70,30-30 +48-71,48-90 +24-95,95-95 +32-83,82-83 +26-59,18-40 +90-92,2-91 +16-73,17-65 +17-97,18-99 +33-33,31-33 +1-97,14-50 +24-96,25-95 +62-62,33-62 +32-32,33-68 +62-81,61-91 +26-55,8-25 +24-64,16-23 +50-64,49-49 +30-94,93-93 +84-95,36-83 +82-97,41-83 +11-33,10-32 +19-27,27-50 +17-60,18-61 +31-85,85-85 +45-70,46-69 +1-6,5-84 +17-86,12-60 +48-94,97-99 +91-96,90-90 +12-75,82-99 +10-77,77-78 +5-7,6-97 +93-98,92-98 +25-36,25-67 +36-37,37-70 +38-58,59-92 +88-88,67-89 +3-91,3-90 +9-71,8-70 +26-70,27-70 +84-86,31-85 +34-83,2-33 +14-58,14-50 +47-81,48-82 +90-91,77-91 +91-92,39-91 +76-78,30-77 +22-53,21-22 +16-87,86-87 +1-3,3-41 +18-27,27-27 +4-97,4-4 +64-67,64-67 +12-13,1-13 +37-59,36-36 +10-96,9-10 +66-67,41-66 +12-45,11-66 +78-94,79-95 +7-95,52-95 +85-85,17-84 +46-57,47-58 +18-74,1-59 +22-63,34-39 +6-73,12-80 +33-85,16-83 +4-47,4-47 +4-4,5-67 +18-65,9-17 +13-88,13-89 +60-79,61-69 +97-98,11-95 +12-96,12-75 +18-18,18-88 +27-81,82-98 +48-48,49-84 +16-58,57-57 +83-84,84-96 +32-42,49-93 +99-99,3-97 +1-95,95-96 +56-68,55-55 +2-2,2-49 +27-59,35-58 +43-86,44-86 +20-75,19-75 +14-95,1-14 +6-93,93-94 +16-95,15-16 +11-16,16-90 +80-80,62-79 +11-51,10-51 +66-91,67-81 +39-42,39-43 +14-18,17-19 +50-54,50-55 +4-71,3-54 +2-98,1-99 +69-71,20-69 +3-52,28-53 +9-45,8-46 +94-95,29-94 +8-89,14-90 +89-91,2-90 +1-58,14-85 +25-25,25-74 +29-82,82-82 +84-97,6-83 +31-92,91-91 +45-78,45-92 +55-58,55-78 +8-85,7-84 +44-90,43-82 +45-58,44-58 +20-27,27-85 +51-69,52-70 +29-50,30-49 +3-3,4-54 +69-73,70-72 +6-7,7-92 +3-8,3-97 +6-65,83-85 +78-81,39-78 +23-47,24-40 +72-74,28-73 +2-2,1-96 +67-93,66-94 +32-33,10-33 +33-89,33-46 +22-39,24-39 +63-74,64-86 +2-39,4-21 +28-71,72-84 +3-64,64-64 +15-69,16-68 +49-86,44-80 +44-80,45-79 +20-20,9-21 +28-41,6-28 +16-54,15-53 +51-93,50-82 +63-70,69-71 +26-79,43-78 +7-59,1-9 +59-63,50-63 +57-58,11-58 +6-91,4-5 +15-20,5-16 +2-79,8-34 +90-90,69-90 +39-67,38-50 +3-79,3-80 +5-97,4-98 +32-97,23-31 +11-98,11-99 +20-75,75-76 +76-77,36-77 +55-55,54-93 +93-94,49-94 +5-96,4-5 +91-93,19-73 +35-77,11-93 +21-43,21-44 +34-83,84-84 +4-38,5-33 +7-7,8-48 +3-96,2-96 +11-90,2-11 +28-79,28-79 +6-96,1-35 +17-30,17-17 +52-52,30-53 +83-94,82-93 +11-13,7-14 +96-96,75-96 +46-59,6-60 +25-76,75-76 +91-91,90-90 +62-87,61-88 +16-69,17-68 +36-43,39-42 +8-87,7-87 +73-75,42-74 +91-98,81-92 +23-95,22-22 +93-95,53-94 +5-92,91-93 +21-41,40-41 +12-97,12-98 +7-98,8-99 +13-97,13-96 +61-62,62-74 +43-45,23-44 +43-45,46-74 +32-69,32-69 +54-56,53-56 +2-76,3-77 +11-74,11-73 +22-75,16-22 +8-80,79-81 +8-27,9-28 +66-80,79-86 +43-43,44-97 +2-74,2-8 +11-78,78-80 +59-82,83-91 +94-94,94-99 +2-86,2-2 +35-35,34-98 +61-63,61-85 +22-76,21-77 +9-35,35-69 +44-79,45-78 +31-66,66-67 +17-95,96-97 +47-79,38-48 +28-94,13-39 +39-73,38-73 +35-64,14-55 +53-95,8-96 +24-94,15-25 +83-84,55-83 +41-68,41-67 +78-91,15-74 +52-79,83-91 +6-9,10-98 +9-37,7-7 +39-47,40-47 +25-97,23-39 +88-88,11-89 +10-88,9-88 +9-84,7-7 +6-91,6-6 +66-75,44-74 +16-85,86-90 +42-57,31-41 +39-74,73-96 +13-87,87-88 +25-26,26-27 +3-11,4-12 +46-74,3-74 +21-96,95-97 +47-64,47-57 +9-42,10-43 +28-77,29-78 +20-38,37-71 +45-98,44-96 +10-61,15-59 +8-98,6-6 +13-67,12-66 +2-97,3-3 +27-28,28-44 +13-67,67-89 +8-71,70-71 +15-49,15-52 +11-75,3-10 +85-85,50-86 +21-88,25-76 +45-71,70-77 +5-81,4-84 +15-64,14-15 +3-95,2-3 +36-46,35-45 +4-23,5-22 +24-48,47-48 +6-27,2-58 +36-58,37-82 +6-66,3-56 +3-29,28-71 +43-83,43-87 +22-79,21-90 +27-45,45-58 +3-37,4-36 +8-9,10-81 +24-99,74-99 +9-42,8-43 +2-98,3-99 +75-76,60-75 +29-83,28-28 +18-26,26-26 +78-95,9-77 +7-71,2-72 +22-88,87-89 +26-28,71-73 +93-96,51-89 +65-65,66-96 +11-19,18-98 +27-62,32-65 +18-69,17-19 +55-56,35-56 +25-71,26-70 +3-96,3-95 +25-96,40-95 +95-95,3-96 +47-65,63-66 +45-53,39-45 +5-84,6-79 +31-91,14-85 +24-31,32-54 +11-48,48-62 +38-51,10-52 +4-90,5-89 +9-44,10-15 +5-11,10-98 +2-4,5-18 +1-98,79-98 +63-90,89-90 +60-69,58-60 +37-95,37-98 +30-77,31-78 +10-21,20-39 +11-30,31-64 +39-86,85-87 +67-79,42-74 +11-76,75-91 +5-30,30-57 +88-90,58-89 +19-90,20-91 +1-1,3-12 +95-95,23-96 +40-76,40-76 +26-46,26-46 +8-56,79-79 +28-81,28-88 +3-65,49-64 +15-51,15-15 +44-78,43-64 +6-82,5-83 +19-56,19-56 +24-52,24-51 +14-88,13-14 +26-97,89-97 +13-86,13-87 +52-80,51-52 +27-55,12-48 +56-82,80-85 +2-29,3-29 +18-87,3-87 +6-35,2-6 +28-36,37-97 +75-87,75-87 +1-99,2-2 +48-48,48-88 +59-92,80-95 +82-87,6-83 +81-97,13-81 +13-75,14-75 +97-98,21-97 +14-93,13-13 +21-32,20-31 +30-71,72-72 +51-75,41-75 +24-84,23-85 +11-11,11-21 +62-81,62-81 +1-3,3-98 +75-78,78-79 +17-96,18-96 +9-98,5-99 +18-49,48-48 +66-66,40-66 +18-72,17-73 +6-87,87-88 +3-44,4-45 +31-54,54-79 +55-59,54-58 +6-6,7-15 +21-98,20-99 +1-2,3-30 +72-77,20-77 diff --git a/y2022/resources/5_input.txt b/y2022/resources/5_input.txt new file mode 100644 index 0000000..c8cad3c --- /dev/null +++ b/y2022/resources/5_input.txt @@ -0,0 +1,512 @@ +[M] [H] [N] +[S] [W] [F] [W] [V] +[J] [J] [B] [S] [B] [F] +[L] [F] [G] [C] [L] [N] [N] +[V] [Z] [D] [P] [W] [G] [F] [Z] +[F] [D] [C] [S] [W] [M] [N] [H] [H] +[N] [N] [R] [B] [Z] [R] [T] [T] [M] +[R] [P] [W] [N] [M] [P] [R] [Q] [L] + 1 2 3 4 5 6 7 8 9 + +move 1 from 7 to 6 +move 1 from 9 to 4 +move 4 from 9 to 6 +move 1 from 2 to 3 +move 7 from 8 to 6 +move 1 from 6 to 3 +move 6 from 2 to 9 +move 1 from 2 to 9 +move 3 from 5 to 6 +move 4 from 5 to 4 +move 1 from 1 to 6 +move 8 from 9 to 4 +move 1 from 5 to 1 +move 7 from 3 to 9 +move 11 from 4 to 1 +move 1 from 9 to 3 +move 1 from 3 to 6 +move 9 from 1 to 2 +move 1 from 4 to 8 +move 1 from 8 to 2 +move 5 from 9 to 4 +move 8 from 2 to 1 +move 10 from 6 to 3 +move 5 from 4 to 3 +move 9 from 3 to 2 +move 1 from 9 to 5 +move 1 from 6 to 1 +move 4 from 1 to 8 +move 5 from 7 to 6 +move 1 from 5 to 9 +move 2 from 4 to 3 +move 13 from 6 to 1 +move 1 from 6 to 3 +move 3 from 1 to 7 +move 9 from 2 to 7 +move 2 from 4 to 6 +move 25 from 1 to 9 +move 2 from 2 to 7 +move 2 from 3 to 5 +move 1 from 6 to 5 +move 2 from 5 to 2 +move 2 from 8 to 9 +move 2 from 2 to 5 +move 23 from 9 to 5 +move 1 from 8 to 5 +move 1 from 8 to 9 +move 6 from 3 to 7 +move 3 from 5 to 7 +move 1 from 3 to 1 +move 1 from 1 to 5 +move 11 from 7 to 6 +move 9 from 6 to 2 +move 1 from 7 to 1 +move 1 from 1 to 7 +move 2 from 6 to 8 +move 8 from 2 to 3 +move 4 from 7 to 1 +move 7 from 7 to 6 +move 6 from 9 to 6 +move 1 from 1 to 5 +move 5 from 6 to 8 +move 2 from 7 to 6 +move 2 from 3 to 2 +move 24 from 5 to 8 +move 1 from 3 to 5 +move 4 from 3 to 2 +move 1 from 5 to 6 +move 31 from 8 to 6 +move 1 from 5 to 6 +move 1 from 3 to 6 +move 2 from 1 to 9 +move 2 from 9 to 6 +move 1 from 1 to 9 +move 46 from 6 to 5 +move 1 from 9 to 4 +move 35 from 5 to 1 +move 28 from 1 to 5 +move 24 from 5 to 3 +move 1 from 3 to 4 +move 1 from 6 to 3 +move 19 from 3 to 4 +move 2 from 3 to 8 +move 3 from 1 to 8 +move 4 from 2 to 1 +move 4 from 8 to 6 +move 6 from 1 to 5 +move 1 from 8 to 5 +move 3 from 4 to 1 +move 5 from 1 to 7 +move 23 from 5 to 2 +move 21 from 2 to 8 +move 6 from 8 to 2 +move 2 from 2 to 5 +move 2 from 5 to 6 +move 5 from 4 to 5 +move 6 from 6 to 7 +move 4 from 5 to 2 +move 1 from 7 to 9 +move 3 from 3 to 2 +move 1 from 5 to 2 +move 2 from 8 to 5 +move 11 from 2 to 5 +move 3 from 2 to 7 +move 13 from 7 to 4 +move 11 from 8 to 1 +move 1 from 9 to 5 +move 23 from 4 to 2 +move 1 from 4 to 9 +move 10 from 1 to 2 +move 1 from 9 to 5 +move 1 from 1 to 3 +move 2 from 8 to 6 +move 4 from 5 to 9 +move 19 from 2 to 5 +move 3 from 9 to 2 +move 28 from 5 to 7 +move 1 from 3 to 5 +move 1 from 9 to 5 +move 15 from 7 to 5 +move 2 from 6 to 4 +move 2 from 4 to 3 +move 19 from 5 to 9 +move 5 from 7 to 5 +move 8 from 7 to 8 +move 1 from 8 to 1 +move 14 from 9 to 6 +move 2 from 8 to 5 +move 1 from 3 to 8 +move 3 from 5 to 9 +move 1 from 1 to 9 +move 3 from 9 to 6 +move 8 from 6 to 5 +move 1 from 8 to 1 +move 1 from 8 to 3 +move 13 from 2 to 4 +move 4 from 9 to 8 +move 4 from 4 to 1 +move 1 from 6 to 1 +move 2 from 3 to 4 +move 2 from 1 to 7 +move 10 from 5 to 1 +move 2 from 5 to 2 +move 7 from 4 to 7 +move 6 from 6 to 7 +move 1 from 9 to 7 +move 3 from 7 to 1 +move 7 from 2 to 7 +move 1 from 6 to 3 +move 1 from 6 to 9 +move 8 from 7 to 8 +move 2 from 7 to 6 +move 8 from 7 to 9 +move 17 from 1 to 7 +move 13 from 8 to 5 +move 2 from 7 to 1 +move 2 from 6 to 3 +move 9 from 7 to 6 +move 5 from 7 to 6 +move 1 from 4 to 5 +move 3 from 5 to 9 +move 4 from 9 to 2 +move 2 from 8 to 6 +move 1 from 7 to 9 +move 4 from 9 to 1 +move 12 from 6 to 2 +move 10 from 2 to 6 +move 4 from 9 to 4 +move 6 from 1 to 6 +move 2 from 7 to 8 +move 2 from 8 to 4 +move 1 from 8 to 1 +move 8 from 4 to 7 +move 5 from 5 to 2 +move 3 from 4 to 1 +move 3 from 2 to 8 +move 2 from 8 to 4 +move 1 from 4 to 5 +move 3 from 2 to 1 +move 2 from 9 to 8 +move 11 from 6 to 5 +move 4 from 7 to 2 +move 1 from 3 to 7 +move 1 from 8 to 5 +move 8 from 6 to 4 +move 2 from 3 to 7 +move 1 from 6 to 2 +move 15 from 5 to 3 +move 15 from 3 to 5 +move 5 from 1 to 6 +move 12 from 2 to 8 +move 4 from 7 to 3 +move 4 from 6 to 3 +move 7 from 4 to 3 +move 8 from 3 to 8 +move 1 from 6 to 8 +move 10 from 5 to 3 +move 8 from 5 to 4 +move 15 from 3 to 9 +move 1 from 1 to 3 +move 9 from 4 to 9 +move 1 from 7 to 3 +move 2 from 7 to 6 +move 1 from 9 to 7 +move 19 from 8 to 2 +move 1 from 1 to 9 +move 4 from 3 to 9 +move 1 from 5 to 6 +move 4 from 8 to 1 +move 1 from 4 to 1 +move 3 from 1 to 3 +move 1 from 1 to 9 +move 4 from 9 to 7 +move 2 from 6 to 1 +move 2 from 1 to 2 +move 1 from 6 to 3 +move 1 from 1 to 4 +move 3 from 7 to 5 +move 21 from 2 to 8 +move 1 from 7 to 8 +move 2 from 5 to 3 +move 1 from 4 to 3 +move 3 from 3 to 1 +move 1 from 7 to 5 +move 1 from 1 to 2 +move 1 from 1 to 2 +move 2 from 3 to 2 +move 1 from 3 to 8 +move 2 from 5 to 6 +move 1 from 3 to 9 +move 4 from 2 to 8 +move 12 from 9 to 6 +move 1 from 1 to 4 +move 14 from 6 to 1 +move 3 from 9 to 1 +move 1 from 4 to 7 +move 4 from 8 to 6 +move 3 from 6 to 4 +move 3 from 4 to 7 +move 15 from 1 to 5 +move 1 from 6 to 5 +move 12 from 5 to 4 +move 10 from 9 to 8 +move 3 from 7 to 8 +move 1 from 9 to 1 +move 2 from 1 to 7 +move 17 from 8 to 5 +move 10 from 4 to 2 +move 16 from 5 to 8 +move 30 from 8 to 7 +move 4 from 5 to 2 +move 4 from 7 to 1 +move 1 from 5 to 8 +move 4 from 8 to 4 +move 5 from 4 to 8 +move 8 from 7 to 8 +move 19 from 7 to 5 +move 4 from 1 to 4 +move 7 from 5 to 3 +move 10 from 2 to 3 +move 5 from 5 to 1 +move 1 from 5 to 3 +move 4 from 2 to 8 +move 4 from 4 to 6 +move 1 from 5 to 7 +move 3 from 7 to 1 +move 1 from 4 to 2 +move 7 from 3 to 7 +move 2 from 5 to 1 +move 1 from 2 to 8 +move 3 from 5 to 2 +move 3 from 2 to 7 +move 11 from 1 to 9 +move 9 from 9 to 6 +move 1 from 3 to 8 +move 2 from 9 to 6 +move 3 from 3 to 7 +move 3 from 7 to 1 +move 5 from 6 to 7 +move 14 from 7 to 6 +move 1 from 7 to 2 +move 5 from 3 to 5 +move 1 from 3 to 4 +move 2 from 1 to 4 +move 1 from 6 to 9 +move 1 from 3 to 8 +move 1 from 9 to 2 +move 1 from 1 to 4 +move 4 from 4 to 9 +move 1 from 2 to 3 +move 5 from 5 to 9 +move 1 from 9 to 5 +move 1 from 5 to 3 +move 11 from 6 to 3 +move 2 from 9 to 1 +move 1 from 1 to 7 +move 5 from 6 to 4 +move 4 from 3 to 9 +move 1 from 3 to 7 +move 1 from 4 to 2 +move 1 from 4 to 5 +move 2 from 2 to 1 +move 1 from 4 to 5 +move 2 from 1 to 6 +move 1 from 3 to 6 +move 8 from 9 to 6 +move 19 from 8 to 7 +move 2 from 7 to 4 +move 1 from 1 to 3 +move 6 from 6 to 5 +move 1 from 8 to 6 +move 8 from 5 to 9 +move 1 from 9 to 8 +move 1 from 4 to 6 +move 1 from 9 to 1 +move 4 from 7 to 5 +move 2 from 4 to 7 +move 1 from 4 to 5 +move 8 from 9 to 5 +move 3 from 8 to 2 +move 8 from 6 to 8 +move 5 from 3 to 1 +move 6 from 8 to 3 +move 9 from 5 to 7 +move 3 from 2 to 4 +move 1 from 6 to 1 +move 2 from 3 to 9 +move 2 from 8 to 1 +move 1 from 4 to 7 +move 1 from 5 to 6 +move 1 from 9 to 3 +move 8 from 3 to 8 +move 2 from 4 to 9 +move 2 from 5 to 7 +move 5 from 8 to 3 +move 2 from 6 to 9 +move 1 from 9 to 5 +move 3 from 9 to 3 +move 3 from 6 to 5 +move 1 from 9 to 6 +move 1 from 8 to 3 +move 4 from 5 to 4 +move 24 from 7 to 5 +move 8 from 3 to 1 +move 24 from 5 to 2 +move 3 from 4 to 6 +move 5 from 6 to 3 +move 1 from 3 to 1 +move 1 from 5 to 2 +move 4 from 2 to 1 +move 5 from 3 to 9 +move 1 from 4 to 3 +move 5 from 2 to 3 +move 3 from 1 to 2 +move 1 from 7 to 1 +move 4 from 7 to 8 +move 1 from 1 to 2 +move 5 from 2 to 8 +move 2 from 9 to 8 +move 19 from 1 to 7 +move 9 from 8 to 9 +move 2 from 3 to 5 +move 8 from 9 to 6 +move 5 from 6 to 2 +move 1 from 3 to 8 +move 2 from 9 to 5 +move 3 from 5 to 9 +move 5 from 9 to 4 +move 2 from 6 to 4 +move 2 from 8 to 3 +move 1 from 5 to 6 +move 3 from 8 to 4 +move 1 from 6 to 9 +move 8 from 4 to 3 +move 19 from 7 to 5 +move 5 from 3 to 6 +move 1 from 4 to 5 +move 1 from 4 to 7 +move 1 from 9 to 1 +move 4 from 6 to 8 +move 1 from 7 to 5 +move 2 from 6 to 4 +move 4 from 8 to 5 +move 6 from 3 to 1 +move 6 from 5 to 8 +move 5 from 5 to 1 +move 2 from 4 to 7 +move 2 from 3 to 2 +move 7 from 5 to 2 +move 1 from 7 to 9 +move 3 from 2 to 6 +move 7 from 2 to 1 +move 4 from 1 to 7 +move 7 from 1 to 7 +move 11 from 2 to 4 +move 3 from 6 to 7 +move 2 from 8 to 5 +move 8 from 7 to 3 +move 6 from 3 to 5 +move 4 from 2 to 3 +move 3 from 7 to 6 +move 3 from 2 to 5 +move 7 from 5 to 1 +move 10 from 1 to 6 +move 1 from 2 to 8 +move 3 from 6 to 7 +move 4 from 4 to 1 +move 2 from 3 to 6 +move 3 from 3 to 9 +move 1 from 3 to 6 +move 4 from 1 to 4 +move 3 from 9 to 6 +move 2 from 4 to 1 +move 9 from 4 to 7 +move 11 from 7 to 4 +move 6 from 1 to 6 +move 6 from 4 to 7 +move 5 from 4 to 7 +move 4 from 8 to 1 +move 1 from 8 to 6 +move 1 from 9 to 7 +move 4 from 6 to 4 +move 5 from 5 to 4 +move 5 from 5 to 9 +move 5 from 1 to 6 +move 1 from 5 to 6 +move 4 from 9 to 7 +move 1 from 9 to 8 +move 7 from 7 to 1 +move 1 from 7 to 8 +move 4 from 1 to 5 +move 5 from 4 to 1 +move 1 from 4 to 8 +move 6 from 1 to 2 +move 11 from 6 to 8 +move 2 from 8 to 9 +move 1 from 5 to 9 +move 6 from 2 to 8 +move 1 from 1 to 2 +move 2 from 7 to 8 +move 1 from 9 to 2 +move 2 from 2 to 8 +move 1 from 7 to 8 +move 10 from 8 to 3 +move 3 from 5 to 9 +move 4 from 8 to 5 +move 4 from 8 to 2 +move 7 from 7 to 8 +move 2 from 5 to 9 +move 1 from 5 to 1 +move 2 from 7 to 8 +move 5 from 3 to 5 +move 1 from 1 to 3 +move 1 from 1 to 6 +move 1 from 2 to 4 +move 7 from 6 to 4 +move 2 from 2 to 3 +move 3 from 8 to 4 +move 2 from 3 to 1 +move 3 from 5 to 6 +move 3 from 6 to 8 +move 1 from 1 to 9 +move 3 from 3 to 1 +move 8 from 8 to 1 +move 1 from 2 to 9 +move 1 from 6 to 2 +move 3 from 5 to 1 +move 1 from 8 to 3 +move 3 from 4 to 1 +move 4 from 8 to 9 +move 1 from 7 to 1 +move 7 from 1 to 6 +move 8 from 9 to 6 +move 1 from 8 to 9 +move 4 from 9 to 8 +move 15 from 6 to 5 +move 3 from 1 to 6 +move 2 from 1 to 2 +move 1 from 2 to 7 +move 1 from 9 to 6 +move 3 from 8 to 1 +move 1 from 4 to 9 +move 11 from 5 to 9 +move 1 from 7 to 1 +move 1 from 2 to 3 +move 2 from 3 to 4 +move 6 from 1 to 7 +move 7 from 4 to 5 +move 2 from 6 to 7 +move 1 from 4 to 5 +move 2 from 4 to 1 +move 13 from 9 to 1 +move 2 from 3 to 2 +move 1 from 3 to 7 +move 2 from 4 to 1 +move 4 from 6 to 9 +move 1 from 8 to 4 +move 4 from 6 to 8 +move 1 from 4 to 9 +move 9 from 1 to 6 +move 8 from 6 to 9 +move 4 from 5 to 3 +move 1 from 8 to 4 diff --git a/y2022/resources/6_input.txt b/y2022/resources/6_input.txt new file mode 100644 index 0000000..534b221 --- /dev/null +++ b/y2022/resources/6_input.txt @@ -0,0 +1 @@ +srjsssgppnssqzszmzjmjdmmqwqcwqccslsjswjssgbsgsnggqtqnnjznndtndnhddfldfdsfswsjsjjptjpttlwlccpnpgngcncnscncsnnwrwmwggsgdgssvbsstzsstqqrjqqlsqlsqscschhclhccznzcnnzzqppjbpjjqzzbwbqqzdqdjjqtjtbtgtqgtgdgwwsjjbwjjzssrsvsttgqtgglgplgpllcrcncssbrbgrbrllsqlsltthshrrnddwzdzdbbrppdvdqvvpvdvdsslbbmnbnjjrdrnntzzftzftttrsshpspvvrzzqzwzhzszbzjjwqwvqqglgflfwfrfprpddfvdffhzztwtppwwwztzsznzmnnbvbbtqqdhqdqdfffnjnmnlmljmlmnlnddzbbdgdqdnqqtjjtnthttvwwtrwwwgffqcfchfcfwcczhhgjhghpgpwgwffhghzghhtftntnnmlnmlmddqbbfwbfwbwvvfssrggptpltpllbcbzczzlccjgcgvcczjzvvvdtvdvqdqwdqdvdjvddjfdjjqmmfgfsftfzfwzwzfftmfmmqdqccjqcqwwflwlccpssvzzzbnbjnbjjgtgpttbwbrbwrwvrrwccgrgrvvpjvvznvvhddtdldpldppmlplltdllhqhpqhqqbpptgpgjgqjgjffvfdvdttsrsllhzlzrrdrnrjrddqbbjrrvrsstgsttjqjhjbhhnmndmmnrmnnrggmtgmmhshjjfqjjtqtstpstppggtzzrsrwwqffvzvzvqqggqsqtstszttpvtvvvddcncvncvchhnsnpsnnlmnnmqnqjjfwfccmwmbwbswbswwghhzrrptptbbjbtjjgdjgjrgrwgwlglblbnlnbbwnnpbnbmbtmtvvhjjlwlhhszslldwlwdllhjhghqghhqpplhhtjhhnhqhlhjhmmlhlmmrpptvvcczfcccwgcccpgpspdpccfhchffbjbzzwppfbbstbtltpllcssnnctnnqcqhhclhccvlvlffnjjwbwfbfttwvvdvnnnsrstrtmtfthtzzcvzvhzzpmpfpmmmwggdbdqdbbjnbbdqbbrnnnprrwbbcwbbpjjprjjzzvwwvrrthhqvhvnhhzmzszrszsjssclcjjbhjbhjbhjbjhhzbbzttnrnssrbrjbrjjmsmffdlflfzfbzzmtztdthdhldhlddnccgbbmtbbsbzsbzzcsszpzfffprfpfzfrzzhvhffsmmqtjwgjbzhnmrslrmgfjpqcllcgsjdhrshqtlgmqqtfmswfzwtnrswtzdjzclcfmltqgdhcsgvzrdltgfbtqclpppvbqnbqmlhmdbsjbwbdllzpnrwfhmnlgvdwsdjsznnhqzhwntjvcpzdrfwmwwdrttdvzspmbmqggmlmsvwgcjgpvcmplqwfjgpghnfpbctnfhcgngcbdmzhlpcnjpmczzsgfgrdftrzgvmmpdmgcrpcdrjsgczpfjnwpdjpntdngdjwctvcbsjmfwvtsrlhvpswppmfwrwzsbsgbjvljzqjjldmnqnmwsmqnmhmqhhttppbpqlvdcvdbhmbnjzztjrdjdzlvmbdrghtftwdpcwwblsjbgnzwtpztmtmnrpsvzfzncqmrvhcbqcvqvnlngdcllrqlbhjttnmjmhfhdzmjmplcfdqpmwblzsnmpczwcnggcwdvgnjcrrtmpwwqdqpvtbzpdbfnbfcfllntqjlslcsznjvzvsbntrtzwhcbtdmbmwttvhdvdtvrcmprcrrjlgsqddrsmwsrbtbpjrmlbrnsdrjfhjnqjtgjmhzjbjnprvmhtjcdbztwqmrlfflfmcslshtwmwhgvbdslgjhzjlglhllsdphlzngjfwfrlwpnqfhghnqhzhgrszbcwjvlrtmshntszsqplvfbccjwctgtfmqgqjdlgdbwhgvctqtcgfdwvqdwqzddmsbrpftzpqztgzbnplvhftmgpdthnrdhqbltbrmhpcqsfccmqzwmrbnbgbjspslwpjhdqspssqdtnssmjmvzwwfstgzzjrmfczdlznwqpdhbsjqddvffcgfhfdqdrlwcsgcsszdtpqbbsthpwbhdfzmgmcdggfcwcmzfjnfbzbccjhvwhbwfslnqnrwhgrwtlnmrmncnjtbjbdlmqsczppgbcmsdrwlrpjbgrmnhqqfhhsdhmdmpvvpjrnzsvzctmqhpzcvcjfgtlfvqvnvlnprmgrsvrrvtjfndqfsvqdsfbcwlbglmfhfhcfgqdfmclnzhdtppgzzsqgjqncqrbdhlhdjqwjpmbdnfmgdgwbwmnlngnmrhcgqwzvmbjzdvsspjwwdtpnvpftdlqlzfgtscfczsvbrtrqqpgqlvmrtddqplbzsswbgpdzpqfvqpqbndblghmdhmnctdnjbgglmrlvmrmsfgntfdwvqcvvlvbcnwrctvjqhmnsjqccwltbfqpqpmwsfvmnnfqmlmlcchqcdtbvqwcpptvfwrwtbdrlsgnwpmjgnwlprzqjlwqmtmjglbrzlgfbsghwqdmwhrcmfwdmzmflsbngtgndftdpzsqvgqdsfdhplmfcmwpbtvcdmpghmfwqjvhdhfpmbrqpvnbhlftgdtprlztrgnlcldfpjqjqdfrvqtcnzrtjcgzgsslzghlnfhwwjwzdsmpsczclrfmnqjvfmvsqpntsnnnlrfswqtrppzhqgjzlzvrrbhhfhchhvgztpgctcsgssvttszsrdwzwrbmwmspgqhmmfnzqqdbmnbltdmrsvqgddltwczbbjcmplncspgqgmzrndhttsrbvqbpbvhshfqrpqgmmdbhmmtccjcmntmpqhrvhnfnlqqbctsnfzjbphhqwmztgbhqqlbctbsfcszbggzrlcdhwddtjgtqhppzgjsqcddwjsngjrcdflmgwgfnzhjtcwgbqvpwmpgcpdwvqgswwfzcnjgmdpffmqczmsqgpthpmsjlwnrcbzrfshvwftzllwrmfccmlpjnmpjdfpcvjgjpznllmqjwpcflgqgdljtbbjvjlvhhmtvzfnjfnnwrvtlfdbhqphrjghtmlsrplqscsnvjvqdslsbsfzzrjfmchplzgjgdqvzhfphvsjfvnqlgmjfzhrdlmmvfntnzdvrnwqshsmtjnqmwzgpbbzszrsqcvlzjwnmgjhmfqrbvgmfqpswctmvpfcghvdqgstglmzvpfhzfzvhqqdmvrvrttlpwwhqgddzqlrvvdffqtznvlfgjhhmvbmtzjqnnhqzrtbzpqcwpngrdcndcgzwhzgtfwbmwbrpvvczczhwcqwsqzqbqvqftcswtcbzdbpccjhtwbpnwlwwwqwscptlwshrdbmmdcgrmpnnwgjwzszwwdwctfspbfqvdjqtrflshrqlbfgpnrmbszwjpcdzbggphgplcgvwljprzmtncsvfwqchttndhpnzmtdvtjqtcsddtqvcmztmjgwqvjhflrjjtnvfpjrnlvzvwvrpbhrzslmrqqzqhnzqnvtqppmncddphbwwsjczmphsrlltzndtqjgdlqgpnlfcvwntstmrgcrjzmmllpwldnwmwzpvzctmhszspcvtgnqthszzsmtdnzwtfddfctpjhscbqgwfpqmzpvqrzvtbrdjzrqprdgbpmzzfbgqcvcdtsfrffcpqwtvdwvtcqlcsdrzntgrhrspznndslmnvptlphpdqgbblfhmgbpmmfwqzlhvzshhpzgfjldqclngbcbrmmnqqvqmwdnjsglsggqfgjldqfbsqgtrwmpdffqlcwwlfhlpqfgwtssnjwzhgvtwqzmhmgwzwmcggmpmrzqrcsmflqsrbnzvdmjcdbnscstqrqhvddsbjpzwsvzswqhcqmgzlvfcnzjrrffzphmrvdbhqbrwpsfqvfqwhqhcgfvfsfttzcdsrjgjwcgvhllszmplmvgczqsbfldnbvrnqccbprjjdwhmqpdjjrnfdlhzdvlfmrldjlqclbjrrtjfsflphzdcdpfpr diff --git a/y2022/resources/7_input.txt b/y2022/resources/7_input.txt new file mode 100644 index 0000000..26bc489 --- /dev/null +++ b/y2022/resources/7_input.txt @@ -0,0 +1,1074 @@ +$ cd / +$ ls +dir cwdpn +dir drzllllv +dir fqflwvh +dir jczm +dir jstfcllw +dir lhltq +dir llpmvt +dir tgmt +dir wcbq +$ cd cwdpn +$ ls +dir mnm +dir nmsvc +dir rgbdq +$ cd mnm +$ ls +82227 grgj +dir plldwn +dir rtpjd +dir shvplq +$ cd plldwn +$ ls +114478 gtpgsvv.jch +58874 gzggrfm.rtw +247491 nrsrmplp +114552 nzrdgsgm.fzh +dir prwm +$ cd prwm +$ ls +269910 rpglpmr.zbh +$ cd .. +$ cd .. +$ cd rtpjd +$ ls +dir pnrbvd +65341 wfjltczw.qnc +$ cd pnrbvd +$ ls +99117 rpglpmr.zbh +$ cd .. +$ cd .. +$ cd shvplq +$ ls +192167 glghcqs +182737 gvzbt +175694 pnrbvd +93278 tmz +$ cd .. +$ cd .. +$ cd nmsvc +$ ls +dir bjnvmpc +59203 czqnrq +dir jstfcllw +dir jtqgbwhb +dir ltqjb +49699 qrjzrq +221657 rmfqqbsj.rzn +45989 rzbgdgp.rpn +dir tmrn +dir vzvwphz +$ cd bjnvmpc +$ ls +181885 gclrw.gzs +dir gfjts +dir hqlmzshr +dir smqzqrm +$ cd gfjts +$ ls +236177 grgj +$ cd .. +$ cd hqlmzshr +$ ls +228388 gpqcdjhl.ctd +$ cd .. +$ cd smqzqrm +$ ls +170034 dqvvd +$ cd .. +$ cd .. +$ cd jstfcllw +$ ls +dir bjnvmpc +$ cd bjnvmpc +$ ls +dir fmjlrc +204754 lzd +48598 pnrbvd +211685 vmn +$ cd fmjlrc +$ ls +169343 rpglpmr.zbh +$ cd .. +$ cd .. +$ cd .. +$ cd jtqgbwhb +$ ls +dir bjnvmpc +dir ddjpm +dir fmtpwm +179486 rqplnfz.dpq +$ cd bjnvmpc +$ ls +dir dbglngc +76133 pnrbvd.tsw +dir rdb +266667 strq.pjn +242869 zvzhfjq.vwv +$ cd dbglngc +$ ls +dir hbfbvdr +dir tlsd +253571 wddhnvl.lsq +$ cd hbfbvdr +$ ls +36586 nmsvc.mpf +$ cd .. +$ cd tlsd +$ ls +78854 phd.phb +$ cd .. +$ cd .. +$ cd rdb +$ ls +102680 drz.gjs +$ cd .. +$ cd .. +$ cd ddjpm +$ ls +227450 cbc.rtp +71376 ltnhnzg.gqb +86244 vpr +$ cd .. +$ cd fmtpwm +$ ls +dir ggpctlh +65644 grgj +92435 swffpq.nnc +$ cd ggpctlh +$ ls +104193 gdc +dir rdmgrtzl +$ cd rdmgrtzl +$ ls +28086 swffpq.nnc +$ cd .. +$ cd .. +$ cd .. +$ cd .. +$ cd ltqjb +$ ls +dir jstfcllw +dir qjgbt +dir rstzf +$ cd jstfcllw +$ ls +165962 rsrsnh.fjf +$ cd .. +$ cd qjgbt +$ ls +dir vjrdcjbr +$ cd vjrdcjbr +$ ls +dir swvlpql +dir wmm +$ cd swvlpql +$ ls +dir lqrf +dir nmsvc +dir wnvtfmfw +$ cd lqrf +$ ls +26615 hbjtfmfw.bbs +$ cd .. +$ cd nmsvc +$ ls +23820 bpfj +77703 llpmvt.hhm +220326 tbbvnzvq +$ cd .. +$ cd wnvtfmfw +$ ls +109078 rpglpmr.zbh +$ cd .. +$ cd .. +$ cd wmm +$ ls +dir nmsvc +$ cd nmsvc +$ ls +285836 zqhwwt.vnj +$ cd .. +$ cd .. +$ cd .. +$ cd .. +$ cd rstzf +$ ls +dir bjnvmpc +dir fwmvpthq +dir llpmvt +dir mpz +226698 qfnjbcb.pdr +dir qpvnfl +dir rmrngqdg +234472 swffpq.nnc +$ cd bjnvmpc +$ ls +118290 jstfcllw.wgq +dir mtctn +dir rjcpn +dir tbrccw +$ cd mtctn +$ ls +230555 jstfcllw +dir nfb +dir pfqv +$ cd nfb +$ ls +dir bqjczmcr +dir brhvhl +227496 grgj +154342 mjwp +$ cd bqjczmcr +$ ls +19020 fzqd +$ cd .. +$ cd brhvhl +$ ls +255839 vtvhvh +$ cd .. +$ cd .. +$ cd pfqv +$ ls +155078 ftccr.qlz +$ cd .. +$ cd .. +$ cd rjcpn +$ ls +180441 fvr.smf +dir ggjrm +dir llpmvt +139942 npbmlv.zst +237442 rjg.jqj +192628 wnwgz.qjp +$ cd ggjrm +$ ls +dir drjzphm +$ cd drjzphm +$ ls +188844 wbzh.nzw +$ cd .. +$ cd .. +$ cd llpmvt +$ ls +dir bhdpfpb +dir jstfcllw +10806 llpmvt.ldp +31293 nmsvc +dir pvz +dir qntnwf +$ cd bhdpfpb +$ ls +78642 wjlwf +$ cd .. +$ cd jstfcllw +$ ls +234658 qrdfwls.ncz +$ cd .. +$ cd pvz +$ ls +194879 nfjsfjvt.zln +$ cd .. +$ cd qntnwf +$ ls +225789 mngq.qqb +$ cd .. +$ cd .. +$ cd .. +$ cd tbrccw +$ ls +dir llpmvt +dir nmsvc +136331 npbmlv.zst +130573 rpglpmr.zbh +dir scpwzh +$ cd llpmvt +$ ls +dir bjnvmpc +$ cd bjnvmpc +$ ls +271647 cdt.scr +$ cd .. +$ cd .. +$ cd nmsvc +$ ls +185622 llpmvt +102596 npbmlv.zst +240 wnwgz.qjp +157313 zlgplvb +$ cd .. +$ cd scpwzh +$ ls +270091 tncccs.lgn +$ cd .. +$ cd .. +$ cd .. +$ cd fwmvpthq +$ ls +dir llpmvt +dir nmsvc +dir ntmfpmr +109316 png.zts +dir pnrbvd +90010 qnqjmn +193177 rpglpmr.zbh +283398 rwvbqll.gvg +dir shgtbbfw +$ cd llpmvt +$ ls +dir bgvjb +59723 fblf.dlq +$ cd bgvjb +$ ls +dir gjtj +dir nmsvc +dir wrwsn +$ cd gjtj +$ ls +74258 mqd.jpq +$ cd .. +$ cd nmsvc +$ ls +227910 dqcl.gzn +286951 llpmvt.sdv +$ cd .. +$ cd wrwsn +$ ls +191813 qjhfjfmb.dms +$ cd .. +$ cd .. +$ cd .. +$ cd nmsvc +$ ls +7096 llpmvt.tms +102123 nfgvtghz.gws +160466 swffpq.nnc +$ cd .. +$ cd ntmfpmr +$ ls +266774 llpmvt +$ cd .. +$ cd pnrbvd +$ ls +dir bbpq +dir nmsvc +181175 pnrbvd.bmg +164233 qpw.vtm +$ cd bbpq +$ ls +125821 nbc +$ cd .. +$ cd nmsvc +$ ls +40100 wthm.twj +$ cd .. +$ cd .. +$ cd shgtbbfw +$ ls +dir zpjqjtsl +$ cd zpjqjtsl +$ ls +112507 wnwgz.qjp +$ cd .. +$ cd .. +$ cd .. +$ cd llpmvt +$ ls +199105 gvgstl +dir nmsvc +133701 npbmlv.zst +dir pnrbvd +102349 rpglpmr.zbh +$ cd nmsvc +$ ls +89208 cbrggdvl.glv +176669 dzm.hlr +$ cd .. +$ cd pnrbvd +$ ls +dir hchfn +dir llpmvt +178532 llpmvt.wwb +$ cd hchfn +$ ls +51572 jpzqrgfn.jhl +281362 qntdtr.jtc +$ cd .. +$ cd llpmvt +$ ls +63202 cdvpwbj +255774 sjs.dql +60903 wnwgz.qjp +274603 zbhwbff +$ cd .. +$ cd .. +$ cd .. +$ cd mpz +$ ls +dir gdfwttff +dir njptwz +dir pnrbvd +dir zcvn +$ cd gdfwttff +$ ls +40626 rpglpmr.zbh +$ cd .. +$ cd njptwz +$ ls +dir jstfcllw +$ cd jstfcllw +$ ls +69007 grgj +$ cd .. +$ cd .. +$ cd pnrbvd +$ ls +153157 rjvtctv +$ cd .. +$ cd zcvn +$ ls +157128 llpmvt.swg +$ cd .. +$ cd .. +$ cd qpvnfl +$ ls +234947 jstfcllw +$ cd .. +$ cd rmrngqdg +$ ls +dir bjnvmpc +80105 llpmvt +185789 llpmvt.plc +dir wvg +$ cd bjnvmpc +$ ls +181438 swffpq.nnc +$ cd .. +$ cd wvg +$ ls +dir hlwjtqzj +191048 ppcjtdbd.blr +$ cd hlwjtqzj +$ ls +9887 pnrbvd.psv +$ cd .. +$ cd .. +$ cd .. +$ cd .. +$ cd .. +$ cd tmrn +$ ls +271916 dbwl +9555 gcfhvjj +198388 grgj +246330 pnrbvd.qbj +dir zzmpts +$ cd zzmpts +$ ls +dir zmsbdc +$ cd zmsbdc +$ ls +204067 swffpq.nnc +$ cd .. +$ cd .. +$ cd .. +$ cd vzvwphz +$ ls +dir nmsvc +dir ntmmcjh +dir rvwjl +103462 wnwgz.qjp +$ cd nmsvc +$ ls +dir bqvdvllf +dir ghdlvvfs +$ cd bqvdvllf +$ ls +61744 grgj +154294 lsmjt +$ cd .. +$ cd ghdlvvfs +$ ls +277273 nmsvc.nwd +$ cd .. +$ cd .. +$ cd ntmmcjh +$ ls +124476 ffdgnspv.bhb +110867 jstfcllw.phg +12568 jstfcllw.vbf +19181 npbmlv.zst +$ cd .. +$ cd rvwjl +$ ls +dir jstfcllw +57593 jstfcllw.fhg +221008 jstfcllw.gwq +12478 lwrbqz.dqm +149624 rsrjp.hvp +$ cd jstfcllw +$ ls +131800 pnrbvd +20154 wnwgz.qjp +$ cd .. +$ cd .. +$ cd .. +$ cd .. +$ cd rgbdq +$ ls +135946 ffqnrsh.qmc +186972 grgj +151369 nmsvc +125605 qgtllf +165348 zhwtbml.zsz +$ cd .. +$ cd .. +$ cd drzllllv +$ ls +dir mzfzzgsv +209144 pnrbvd.gdv +$ cd mzfzzgsv +$ ls +237212 pnrbvd.fsp +$ cd .. +$ cd .. +$ cd fqflwvh +$ ls +10557 grgj +11071 gslbvz.gch +dir jzlgzd +dir jzwwgjh +209490 mlhnjvhq +dir nfh +99206 nmlcf +dir pqtgln +139022 rpglpmr.zbh +$ cd jzlgzd +$ ls +223773 zhvgczs.rwv +$ cd .. +$ cd jzwwgjh +$ ls +80522 fvm.tdd +$ cd .. +$ cd nfh +$ ls +dir bfj +dir bjnvmpc +219887 bnnb.mzf +145633 grgj +93312 llpmvt +65642 mfdfjzrw.lzh +dir nbfsjvzn +269811 nmsvc +dir pnrbvd +dir qhn +dir rphmrdnc +dir vnjvqs +dir zqgmm +$ cd bfj +$ ls +dir bzrfbfp +dir pnrbvd +dir rbq +$ cd bzrfbfp +$ ls +34834 swffpq.nnc +$ cd .. +$ cd pnrbvd +$ ls +68732 wnwgz.qjp +$ cd .. +$ cd rbq +$ ls +91779 grgh.vwl +$ cd .. +$ cd .. +$ cd bjnvmpc +$ ls +114048 jstfcllw +$ cd .. +$ cd nbfsjvzn +$ ls +44465 vbtsdf.dqn +157458 wnwgz.qjp +$ cd .. +$ cd pnrbvd +$ ls +40294 dhgbmdl.lbg +119065 fbghtps +271425 glbzmbn.jqd +231623 hsj.vws +$ cd .. +$ cd qhn +$ ls +dir fsgn +175155 hvcfgv +30969 llpmvt.vqf +dir lwmccr +dir svzhc +276798 tgvzbm +dir vblpsfqz +$ cd fsgn +$ ls +dir btpqsr +30980 grgj +dir hjgphwdc +116742 hsrlwwqg +194210 pnrbvd.vrm +105346 rjwvfz +182505 smpnrnm +dir vwpsrq +$ cd btpqsr +$ ls +98971 brf +dir jcj +79166 lrpfbnht.fcz +94138 pnrbvd.gnr +288381 qhg +$ cd jcj +$ ls +189962 npbmlv.zst +$ cd .. +$ cd .. +$ cd hjgphwdc +$ ls +72389 npbmlv.zst +$ cd .. +$ cd vwpsrq +$ ls +dir bnqwnmg +dir ljjmwc +43797 llpmvt.srd +dir nmsvc +$ cd bnqwnmg +$ ls +281017 lvtj.vzc +$ cd .. +$ cd ljjmwc +$ ls +239040 fzb.rwh +$ cd .. +$ cd nmsvc +$ ls +262978 thrgcv.bhr +$ cd .. +$ cd .. +$ cd .. +$ cd lwmccr +$ ls +166022 grgj +$ cd .. +$ cd svzhc +$ ls +dir hpp +208916 jrhblvdc.nvm +133836 nmsvc.qms +4542 npbmlv.zst +105516 plwhmppw.phw +dir pnrbvd +93339 zcdpgl.fjz +$ cd hpp +$ ls +dir gnj +dir nprpdwj +dir pwg +35124 rggng.zbj +238667 szbqvgcg.mnc +dir zswbcbpz +$ cd gnj +$ ls +188603 zwdttf +$ cd .. +$ cd nprpdwj +$ ls +dir jstfcllw +$ cd jstfcllw +$ ls +149966 rpglpmr.zbh +$ cd .. +$ cd .. +$ cd pwg +$ ls +45034 wwpgmrhq +$ cd .. +$ cd zswbcbpz +$ ls +269836 llpmvt +129184 sntr +$ cd .. +$ cd .. +$ cd pnrbvd +$ ls +135401 rpglpmr.zbh +$ cd .. +$ cd .. +$ cd vblpsfqz +$ ls +54358 qdqrlsz.zgz +$ cd .. +$ cd .. +$ cd rphmrdnc +$ ls +189190 jzlgndht +$ cd .. +$ cd vnjvqs +$ ls +254178 wnwgz.qjp +$ cd .. +$ cd zqgmm +$ ls +dir cblp +dir mvgjj +85521 wnwgz.qjp +$ cd cblp +$ ls +131189 rpglpmr.zbh +$ cd .. +$ cd mvgjj +$ ls +215880 ddv +$ cd .. +$ cd .. +$ cd .. +$ cd pqtgln +$ ls +80302 rpglpmr.zbh +14147 rrsghb.ddq +149326 zsrjpr.gwp +$ cd .. +$ cd .. +$ cd jczm +$ ls +dir bhwgcrm +$ cd bhwgcrm +$ ls +257143 wnwgz.qjp +$ cd .. +$ cd .. +$ cd jstfcllw +$ ls +dir fnnjdr +dir llpmvt +dir lpbrvhw +dir pnrbvd +$ cd fnnjdr +$ ls +dir bjnvmpc +dir ccbn +dir llpmvt +$ cd bjnvmpc +$ ls +dir ftlf +160613 pnrbvd +dir rhzsnr +$ cd ftlf +$ ls +dir rrdzzgtg +$ cd rrdzzgtg +$ ls +43707 dpbchhz.jrl +$ cd .. +$ cd .. +$ cd rhzsnr +$ ls +13607 bjnvmpc.dlz +123612 dqt.cdm +155260 grgj +dir jstfcllw +dir llpmvt +228650 nmsvc +dir sbsqrg +229752 swffpq.nnc +$ cd jstfcllw +$ ls +dir fcbs +101671 npbmlv.zst +$ cd fcbs +$ ls +dir qtsrhfv +$ cd qtsrhfv +$ ls +94962 wnwgz.qjp +$ cd .. +$ cd .. +$ cd .. +$ cd llpmvt +$ ls +dir bjnvmpc +dir gdjshcz +dir gtrdds +23262 mzw +dir nhwvgjcq +267083 npbmlv.zst +$ cd bjnvmpc +$ ls +211744 bjnvmpc +$ cd .. +$ cd gdjshcz +$ ls +57871 swffpq.nnc +$ cd .. +$ cd gtrdds +$ ls +dir ngl +$ cd ngl +$ ls +dir nqrwdstp +$ cd nqrwdstp +$ ls +dir fdz +$ cd fdz +$ ls +254070 wnwgz.qjp +$ cd .. +$ cd .. +$ cd .. +$ cd .. +$ cd nhwvgjcq +$ ls +dir llpmvt +$ cd llpmvt +$ ls +245064 grgj +$ cd .. +$ cd .. +$ cd .. +$ cd sbsqrg +$ ls +39334 fcrw.wfs +$ cd .. +$ cd .. +$ cd .. +$ cd ccbn +$ ls +249206 grgj +174074 hdjdpdrq.sdw +255071 llpmvt.wbd +112408 swffpq.nnc +dir tfsgzdsl +57326 wwjt.hqb +$ cd tfsgzdsl +$ ls +86067 bjnvmpc +177455 gmznt +$ cd .. +$ cd .. +$ cd llpmvt +$ ls +dir btjdllpn +dir zgt +$ cd btjdllpn +$ ls +136706 btchp +$ cd .. +$ cd zgt +$ ls +44873 vmh.mfd +$ cd .. +$ cd .. +$ cd .. +$ cd llpmvt +$ ls +5472 ldj +128075 npbmlv.zst +138116 pnrbvd.lcm +$ cd .. +$ cd lpbrvhw +$ ls +284468 pnrbvd.bcg +46353 pnrbvd.bdd +dir pszldqqh +dir wdlp +$ cd pszldqqh +$ ls +89993 wnwgz.qjp +$ cd .. +$ cd wdlp +$ ls +104582 grgj +208979 swffpq.nnc +136509 vhjbdgfj +$ cd .. +$ cd .. +$ cd pnrbvd +$ ls +dir jsnfn +dir smhjmb +$ cd jsnfn +$ ls +30250 rpglpmr.zbh +$ cd .. +$ cd smhjmb +$ ls +270898 fpj.trq +63893 wnwgz.qjp +$ cd .. +$ cd .. +$ cd .. +$ cd lhltq +$ ls +dir dqqcgn +dir jstfcllw +242417 jstfcllw.ngw +183883 rpglpmr.zbh +dir wwvlv +$ cd dqqcgn +$ ls +153306 swffpq.nnc +99780 tpdgtnl +$ cd .. +$ cd jstfcllw +$ ls +dir jdssgdpv +79041 mhwcgqzs.mqc +dir nmsvc +148785 swffpq.nnc +236989 wnwgz.qjp +$ cd jdssgdpv +$ ls +127036 bgjwsm.qqc +107115 nmsvc.fnv +$ cd .. +$ cd nmsvc +$ ls +91006 dvbqm.nfl +206666 tsgcwc.fvj +$ cd .. +$ cd .. +$ cd wwvlv +$ ls +dir jstfcllw +44003 pdq +$ cd jstfcllw +$ ls +48099 fcfnptrl +$ cd .. +$ cd .. +$ cd .. +$ cd llpmvt +$ ls +179597 llpmvt +dir ndn +$ cd ndn +$ ls +220080 btsc.zmc +190391 hhz +113172 jvlfb +33050 wnwgz.qjp +$ cd .. +$ cd .. +$ cd tgmt +$ ls +53361 lml.dnh +44579 psgvcrdd +$ cd .. +$ cd wcbq +$ ls +dir bjnvmpc +dir cnwczqp +dir dpgwtwp +dir gtsf +dir nmsvc +182848 qgh.qnh +$ cd bjnvmpc +$ ls +224127 bbzdcqf +267019 bjnvmpc.zhg +263703 dspvfhr.mmh +dir glwzwcvm +dir hrjjrrvl +dir nqbrm +3983 ntsqzpp.lnl +$ cd glwzwcvm +$ ls +167421 bjnvmpc.zsj +dir llpmvt +$ cd llpmvt +$ ls +167790 llpmvt.jhw +$ cd .. +$ cd .. +$ cd hrjjrrvl +$ ls +91994 crlfnccb.svl +2227 swffpq.nnc +$ cd .. +$ cd nqbrm +$ ls +165605 rpglpmr.zbh +$ cd .. +$ cd .. +$ cd cnwczqp +$ ls +dir cfdn +dir jdh +$ cd cfdn +$ ls +dir bjnvmpc +163111 gsmhfr +dir phtt +$ cd bjnvmpc +$ ls +257093 jstfcllw +$ cd .. +$ cd phtt +$ ls +219526 bgvm.mnq +$ cd .. +$ cd .. +$ cd jdh +$ ls +dir wjzzvs +$ cd wjzzvs +$ ls +135287 rpglpmr.zbh +$ cd .. +$ cd .. +$ cd .. +$ cd dpgwtwp +$ ls +dir vmwvpjn +$ cd vmwvpjn +$ ls +dir bjnvmpc +86191 hdcb.dhp +140007 jstfcllw.tdd +128243 npbmlv.zst +$ cd bjnvmpc +$ ls +8694 grgj +166456 pnrbvd.hdn +$ cd .. +$ cd .. +$ cd .. +$ cd gtsf +$ ls +231856 bjnvmpc +225380 bmm.vwc +dir llpmvt +dir pqm +279010 wnwgz.qjp +$ cd llpmvt +$ ls +143990 nhbpmvb.pgn +dir pnrbvd +$ cd pnrbvd +$ ls +158450 ghjlw +$ cd .. +$ cd .. +$ cd pqm +$ ls +147513 grgj +$ cd .. +$ cd .. +$ cd nmsvc +$ ls +dir znlgg +$ cd znlgg +$ ls +170386 djdv.gbf diff --git a/y2022/resources/8_input.txt b/y2022/resources/8_input.txt new file mode 100644 index 0000000..d9a736a --- /dev/null +++ b/y2022/resources/8_input.txt @@ -0,0 +1,99 @@ +102200120221123133322123221134224301040024344534431245323303212210030001244234132301200020310012011 +210101220131232022104432220132221131234351145114524135253112332342312410211104233102330122201111010 +002220112233222031400442434031011023425412431121343221233533224144034042201244323431032200232101012 +200202231012120110032413231132224255311432523511252253221451514335154032332342133133133321000002220 +021023013300203310410132030422351131224513211322513324212421215535543510221102312443303330132321201 +001000330003220124130413311435314333354422521213321212242324211253514231442434324114124112323213001 +100102012222213131014440444431424445231224532554231331431314545111552115245032312032141101232330001 +112030330123430022102413341315541514452151222122465233323221252533543352235542444442034423330030001 +212220032321414402242244545523153553234542346353663246322653331223132222122541241230343040131203330 +223102313102121144404243154422531311366656226224656422433224222614245141545331252010213304333030112 +100313021142341022443315312525141153654243246335365444433433242564631411555354514413134142003013020 +122100230243123431213132113351516264232625236426434255344356324456666353241325433254422420014331213 +011210132432422344542335312531565433356653464522633446652252525265444443411223445354243041444410112 +012133444121412434113141455535326243636244246332533653666555655543624564414533423445222430103212001 +113304142301420414252411342353422662436622352326554363565223456253643362524444125221430220323313003 +001122120140431312155253523546562455546532337333734675677655555353242655326323332554242403211400130 +220142433201434435251233346626262436553645465666436354364343766652325424552325555415524344132040133 +320312104024221552154216633626342464343336367474637464363774565432432226533664243124324341232022302 +021242423424424124554553554665252264547377663445576756547536647776752524253664541521223254440241211 +224110204241522415245443625466664753754755446565575545765564376455744544623665244525325432143401021 +123432321343113542235654656235537756354436347355473343434764344347577566652236626435125155304243232 +111402302541335421642222546635377463553444734465334736537344446664655457236454264531411125250241041 +404243032431142122562535544633766456373766657455756567565566363544655474453243534523435114313430121 +324421025342212256655666646657743477746456644785547574464646443645543543772542656432522353312430232 +001414034352355125223334566537547773645784645548858657864456755667733554477463225644645134533303241 +120200313513214346523222343534564536445747674784578474688866757844677344466452533232643351552212344 +140004115211334466633442746534576475745584467454447866848876885674465363455562246436243422245134202 +240311554155422565345224744376657664864784867858785584464568776546846456646764446265456535141322412 +120433124512123235464464474374555586847475678876745784486754865847644364763436544532466611335224012 +203035433353423566534634356646374787666466647567896557758654565578474554555573556364424245252252414 +303212242114562363256553377464644876787465779966759998978596466765544677666544346655666361143511511 +321435212244453243635446333355488787767685799988798856567786944567778876663776374463333531123254443 +321335455154254226677665466555765485559588886969685888679596565587486648633737637533532565154423142 +212254414122253423565743374454588455585686588899875787766987689775655787747564557655455342253355324 +421422342453446266357576668665558765689955566967658699885985767778745455574334765743326436551224544 +322421225225343446747576654567854856855589798985878786666568869665488456645344737545652626331455433 +222122521256633657563766766555546555855966796578977676986675868875545864778446455474333436233525114 +023254314555364655763674546647685985696665859897979798699895787776754674648744636743425352264545211 +225135212533322677553356845558877878985878796877869899696786965865955448755574744366722233654152541 +351532143355433244443675556588657988776586966876989779969768796786657855888885536646664425523132442 +124515553625366556335768876868569859658686789999979886979876785986595667566478737355543355336355531 +014314156442535433773675645776556955878889968787696997666987675979557987658877644756564444225521113 +242252525623363454375455757457997976769999667777997788867869896685899586858856533746453433352234235 +023124456566552443376536887866777785856779768999879768967669699896775996557775364533554542434243532 +223212425265546436677586688558777558698896789789999779996888676857756888467864635543336466465124415 +515252333623442437447768566445979556986878966888877987877868886887578986858454675534554625552123132 +412113362546222337753387655589789688778666867977779997787677869678997869748548765747344532346625545 +352443343534562353437684565877667578896989969879787778999697976996568955766447746674356435354542353 +244532256342454775576468664478555979788879687779998799789879799769756679848467875743746256555435243 +252415145222625746477544486589996556968998687777998898799777866997997988457845575665744522252455434 +121252366666324777366354648567898987766689978889888798878866677775798597554668636346634424246241143 +542231223323635647757665768465587586899676779988899797877986698665695688447754433537676242553421153 +315225522426633565736564558659658677797979699989788878799876868665785765575768537473673552525343311 +341442555252446433735587744487688988999678768989777798879679969679999999468485664567446334355524445 +211522352343562564765585578469688867869667998977797998798888877686996875745458474656532245544211451 +443143434636652677635354556867668988666786999778788779898699967757566589857774775447532524634131213 +354152534456625467746446747678795956888788886888778789977879678658675695565654557453375652556521414 +332344344563334636745465546446885667986686979788897779997969896886588854565468765446733444424331344 +431135355245345747455456787578659995678989886897697777968798896878886857486556576564733534432142551 +433233316556526255633378546755489975567978866786699677769889695967977758448667443757622555435434414 +314545435553452545376335754568779985959566976978878677678777868796558868674848566345422265562252423 +145542533645544657663644857446856777777978979788686887887779999586699644786474643375746262664243444 +241353431554264566677765464654485867995877868699696987786976958699567574887566645746345422454143441 +423135115666355654375646368544778695956967666977986977697899789689766567785666675773435325262524551 +121242511146354267445534487686788465757658866587778978657999996978874566576767474455232556422235215 +123455555234455453537357738876787679765895779577559859577987565678475674467346366664333243354411434 +113111232245536443357354765765648848855685798699976566767695895956674785776437653532662646355133522 +034245121152464645264454454458567747667859589888698959868659799684876674563464553323545665335113414 +321542511513646356466656747484676777865877857765878865985699957645675457654757775562546453441355233 +001025225344365554343664374675774455757659659777596798967769555466788558746776567242245663132335222 +240224423154453466635367766446776854675446678578756687675776756657745777743437435645463423354213440 +143321412151126564642553643433487476454478865659797785666686467645568676646646473662544534334515212 +300115342534164343654435573634646548844886487647548855785866576457458436355575564454635251454435213 +331024513222536555236525434736356587874465687545468546688486445577473343474477264254545135125421102 +243234315251353456432325545375553348757866746774448555444556677858854465433745435663355535522444302 +222242353531424355464446643456665437556444758477468585685746584584647636633743354324232532231543430 +232321431115224556244223336543364633735554888856857755655758564767754545375346544656511252413530322 +443102445423141155626432534467654356676376855848756755575858656334754446333542345522445552422021421 +122144244122552411433244654557543734547646557548877564645335454433576334464425263323112222114003403 +241010140424452455226655236255746455563753554474656337467375374536454766656446525662141142521030310 +003123001114142554125526633642767765437644573343536573563636666365667652335363363321131215341024444 +122433034123242324526252334224465375535435776677656444337356333564364442536426546535413351434442403 +012032130443313512142334334232632463533753446736437357543755653745644654244446442551351434201043201 +123432104214215425255545532345225366546356457753453435764534444432222425353255324435341532212441100 +122231022230433534232123222566354453436645454476533354465573437634666223324445223122344241413403220 +112110012033231221323443134255336365322364443757433347343746254333526424644325111313532214100130002 +000013103142014413122533343334343335263464325254335443366245355455625252566552214225151144323332120 +313300010430420353244125522132426466255355444624632264532642466635524442242431233341320143344442332 +232120313033343242144144352243623263245464423245465622443446436362336321555545313154201324441110203 +103011001110214411345544335425116266333555324456646522333423435432424344435555224341402040022203300 +222303333302140132001312342553322343232445543335233323222554662464411343213214525220341304342100233 +231113123213311002102322233322235413333535624634455543444366422633445212132343132400040434221232230 +103320010113214231110254523114243444121544236632534455264632443421454553331443122123000343120020102 +213132131011312123433303212223431254241531411266432544214153545355412323324230143343304101121201113 +110210203103022203344123142431553332324551324112424531442554431321223224324223004404030411100120120 +120111302211224404102444220332233212524433322312343524235355245433352212141024210012324123323312101 +212220310221122231114014131431245134434533152114425513144445231545452244244103411331010011212031200 +211120022231100333330313111120423213143252332533514251453113433321354142442041432101120010313310122 +111210213300233203233222413444104203323252533215253431341253534525013210232012413312211122123302112 diff --git a/y2022/resources/9_input.txt b/y2022/resources/9_input.txt new file mode 100644 index 0000000..06d1917 --- /dev/null +++ b/y2022/resources/9_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 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 +L 11 +R 6 +L 16 +U 19 +R 2 +D 10 +L 15 +D 7 +U 19 +D 1 +U 5 +L 3 diff --git a/y2022/src/bin/d1.rs b/y2022/src/bin/d1.rs new file mode 100644 index 0000000..16728ff --- /dev/null +++ b/y2022/src/bin/d1.rs @@ -0,0 +1,20 @@ +use std::fs; + +use y2022::days::d1; + +fn main() { + part1(); + part2(); +} + +fn part1() { + let root = env!("CARGO_MANIFEST_DIR"); + let content = fs::read_to_string(format!("{root}/resources/1_input.txt")).unwrap(); + println!("{}", d1::process_part1(&content)); +} + +fn part2() { + let root = env!("CARGO_MANIFEST_DIR"); + let content = fs::read_to_string(format!("{root}/resources/1_input.txt")).unwrap(); + println!("{}", d1::process_part2(&content)); +} diff --git a/y2022/src/bin/d2.rs b/y2022/src/bin/d2.rs new file mode 100644 index 0000000..08e557a --- /dev/null +++ b/y2022/src/bin/d2.rs @@ -0,0 +1,20 @@ +use std::fs; + +use y2022::days::d2::{process_part1, process_part2}; + +fn main() { + part1(); + part2(); +} + +fn part1() { + let root = env!("CARGO_MANIFEST_DIR"); + let content = fs::read_to_string(format!("{root}/resources/2_input.txt")).unwrap(); + println!("{}", process_part1(&content)); +} + +fn part2() { + let root = env!("CARGO_MANIFEST_DIR"); + let content = fs::read_to_string(format!("{root}/resources/2_input.txt")).unwrap(); + println!("{}", process_part2(&content)); +} diff --git a/y2022/src/bin/d3.rs b/y2022/src/bin/d3.rs new file mode 100644 index 0000000..128e9ee --- /dev/null +++ b/y2022/src/bin/d3.rs @@ -0,0 +1,20 @@ +use std::fs; + +use y2022::days::d3; + +fn main() { + part1(); + part2(); +} + +fn part1() { + let root = env!("CARGO_MANIFEST_DIR"); + let content = fs::read_to_string(format!("{root}/resources/3_input.txt")).unwrap(); + println!("{}", d3::process_part1(&content)); +} + +fn part2() { + let root = env!("CARGO_MANIFEST_DIR"); + let content = fs::read_to_string(format!("{root}/resources/3_input.txt")).unwrap(); + println!("{}", d3::process_part2(&content)); +} diff --git a/y2022/src/bin/d4.rs b/y2022/src/bin/d4.rs new file mode 100644 index 0000000..429e016 --- /dev/null +++ b/y2022/src/bin/d4.rs @@ -0,0 +1,20 @@ +use std::fs; + +use y2022::days::d4; + +fn main() { + part1(); + part2(); +} + +fn part1() { + let root = env!("CARGO_MANIFEST_DIR"); + let content = fs::read_to_string(format!("{root}/resources/4_input.txt")).unwrap(); + println!("{}", d4::process_part1(&content)); +} + +fn part2() { + let root = env!("CARGO_MANIFEST_DIR"); + let content = fs::read_to_string(format!("{root}/resources/4_input.txt")).unwrap(); + println!("{}", d4::process_part2(&content)); +} diff --git a/y2022/src/bin/d5.rs b/y2022/src/bin/d5.rs new file mode 100644 index 0000000..89a512b --- /dev/null +++ b/y2022/src/bin/d5.rs @@ -0,0 +1,20 @@ +use std::fs; + +use y2022::days::d5; + +fn main() { + part1(); + part2(); +} + +fn part1() { + let root = env!("CARGO_MANIFEST_DIR"); + let content = fs::read_to_string(format!("{root}/resources/5_input.txt")).unwrap(); + println!("{}", d5::process_part1(&content)); +} + +fn part2() { + let root = env!("CARGO_MANIFEST_DIR"); + let content = fs::read_to_string(format!("{root}/resources/5_input.txt")).unwrap(); + println!("{}", d5::process_part2(&content)); +} diff --git a/y2022/src/bin/d6.rs b/y2022/src/bin/d6.rs new file mode 100644 index 0000000..744ad14 --- /dev/null +++ b/y2022/src/bin/d6.rs @@ -0,0 +1,20 @@ +use std::fs; + +use y2022::days::d6; + +fn main() { + part1(); + part2(); +} + +fn part1() { + let root = env!("CARGO_MANIFEST_DIR"); + let content = fs::read_to_string(format!("{root}/resources/6_input.txt")).unwrap(); + println!("{}", d6::process_part1(&content)); +} + +fn part2() { + let root = env!("CARGO_MANIFEST_DIR"); + let content = fs::read_to_string(format!("{root}/resources/6_input.txt")).unwrap(); + println!("{}", d6::process_part2(&content)); +} diff --git a/y2022/src/bin/d7.rs b/y2022/src/bin/d7.rs new file mode 100644 index 0000000..0c44e5a --- /dev/null +++ b/y2022/src/bin/d7.rs @@ -0,0 +1,20 @@ +use std::fs; + +use y2022::days::d7; + +fn main() { + part1(); + part2(); +} + +fn part1() { + let root = env!("CARGO_MANIFEST_DIR"); + let content = fs::read_to_string(format!("{root}/resources/7_input.txt")).unwrap(); + println!("{}", d7::process_part1(&content)); +} + +fn part2() { + let root = env!("CARGO_MANIFEST_DIR"); + let content = fs::read_to_string(format!("{root}/resources/7_input.txt")).unwrap(); + println!("{}", d7::process_part2(&content)); +} diff --git a/y2022/src/bin/d8.rs b/y2022/src/bin/d8.rs new file mode 100644 index 0000000..c93f452 --- /dev/null +++ b/y2022/src/bin/d8.rs @@ -0,0 +1,20 @@ +use std::fs; + +use y2022::days::d8; + +fn main() { + part1(); + part2(); +} + +fn part1() { + let root = env!("CARGO_MANIFEST_DIR"); + let content = fs::read_to_string(format!("{root}/resources/8_input.txt")).unwrap(); + println!("{}", d8::process_part1(&content)); +} + +fn part2() { + let root = env!("CARGO_MANIFEST_DIR"); + let content = fs::read_to_string(format!("{root}/resources/8_input.txt")).unwrap(); + println!("{}", d8::process_part2(&content)); +} diff --git a/y2022/src/bin/d9.rs b/y2022/src/bin/d9.rs new file mode 100644 index 0000000..b304a60 --- /dev/null +++ b/y2022/src/bin/d9.rs @@ -0,0 +1,20 @@ +use std::fs; + +use y2022::days::d9; + +fn main() { + part1(); + part2(); +} + +fn part1() { + let root = env!("CARGO_MANIFEST_DIR"); + let content = fs::read_to_string(format!("{root}/resources/9_input.txt")).unwrap(); + println!("{}", d9::process_part1(&content)); +} + +fn part2() { + let root = env!("CARGO_MANIFEST_DIR"); + let content = fs::read_to_string(format!("{root}/resources/9_input.txt")).unwrap(); + println!("{}", d9::process_part2(&content)); +} diff --git a/y2022/src/days/d1.rs b/y2022/src/days/d1.rs new file mode 100644 index 0000000..3874d3e --- /dev/null +++ b/y2022/src/days/d1.rs @@ -0,0 +1,49 @@ +pub fn process_part1(input: &str) -> i32 { + let mut vector: Vec = input + .split("\n\n") + .map(|lines| lines.lines().map(|line| line.parse::().unwrap()).sum()) + .collect(); + vector.sort_by(|a, b| b.cmp(a)); + vector[0] +} + +pub fn process_part2(input: &str) -> i32 { + let mut vector: Vec = input + .split("\n\n") + .map(|lines| lines.lines().map(|line| line.parse::().unwrap()).sum()) + .collect(); + vector.sort_by(|a, b| b.cmp(a)); + vector.iter().take(3).sum() +} + +#[cfg(test)] +mod tests { + use super::*; + + const INPUT: &str = "1000 +2000 +3000 + +4000 + +5000 +6000 + +7000 +8000 +9000 + +10000"; + + #[test] + fn it_works() { + let result = process_part1(INPUT); + assert_eq!(result, 24000); + } + + #[test] + fn part2() { + let result = process_part2(INPUT); + assert_eq!(result, 45000); + } +} diff --git a/y2022/src/days/d2.rs b/y2022/src/days/d2.rs new file mode 100644 index 0000000..e92a935 --- /dev/null +++ b/y2022/src/days/d2.rs @@ -0,0 +1,106 @@ +pub fn process_part1(input: &str) -> i32 { + let result = input + .lines() + .map(|round| { + let (opponent_move, my_move) = round.split_once(" ").unwrap(); + get_points(opponent_move, my_move) + }) + .sum(); + result +} + +fn get_points(opponent_move: &str, my_move: &str) -> i32 { + let mut round_score = 0; + match my_move { + "X" => { + round_score += 1; + match opponent_move { + "C" => round_score += 6, + "A" => round_score += 3, + _ => (), + } + } + "Y" => { + round_score += 2; + match opponent_move { + "A" => round_score += 6, + "B" => round_score += 3, + _ => (), + } + } + "Z" => { + round_score += 3; + match opponent_move { + "B" => round_score += 6, + "C" => round_score += 3, + _ => (), + } + } + _ => panic!("Shouldn't happen"), + } + round_score +} + +pub fn process_part2(input: &str) -> i32 { + let result = input + .lines() + .map(|round| { + let (opponent_move, round_result) = round.split_once(" ").unwrap(); + get_points_fixed(opponent_move, round_result) + }) + .sum(); + result +} + +fn get_points_fixed(opponent_move: &str, round_result: &str) -> i32 { + let mut round_score = 0; + match round_result { + "X" => match opponent_move { + "A" => round_score += 3, + "B" => round_score += 1, + "C" => round_score += 2, + _ => (), + }, + "Y" => { + round_score += 3; + match opponent_move { + "A" => round_score += 1, + "B" => round_score += 2, + "C" => round_score += 3, + _ => (), + } + } + "Z" => { + round_score += 6; + match opponent_move { + "A" => round_score += 2, + "B" => round_score += 3, + "C" => round_score += 1, + _ => (), + } + } + _ => panic!("Shouldn't happen"), + } + round_score +} + +#[cfg(test)] +mod tests { + use super::*; + + const INPUT: &str = "A Y +B X +C Z"; + + #[test] + fn it_works() { + let result = process_part1(INPUT); + assert_eq!(result, 15); + } + + #[test] + fn part2() { + let result = process_part2(INPUT); + assert_eq!(result, 12); + } +} diff --git a/y2022/src/days/d3.rs b/y2022/src/days/d3.rs new file mode 100644 index 0000000..75d1af9 --- /dev/null +++ b/y2022/src/days/d3.rs @@ -0,0 +1,68 @@ +fn char_to_prio(char: char) -> i32 { + let ascii = char as i32; + match ascii { + 65..=90 => ascii - 38, + 97..=122 => ascii - 96, + _ => panic!("Shouldn't happen"), + } +} + +pub fn process_part1(input: &str) -> i32 { + input + .lines() + .map(|line| { + let (first, second) = line.split_at(line.len() / 2); + let mut prio = 0; + for first_char in first.chars() { + let found_char = second + .chars() + .find(|second_char| second_char.eq(&first_char)); + if let Some(char) = found_char { + prio = char_to_prio(char); + break; + } + } + prio + }) + .sum() +} + +pub fn process_part2(input: &str) -> i32 { + let mut lines = input.lines(); + let mut result = 0; + while let Some(elf_1) = lines.next() { + let elf_2 = lines.next().unwrap(); + let elf_3 = lines.next().unwrap(); + for elf_1_char in elf_1.chars() { + if elf_2.contains(elf_1_char) && elf_3.contains(elf_1_char) { + result += char_to_prio(elf_1_char); + break; + } + } + } + result +} + +#[cfg(test)] +mod tests { + use super::*; + + const INPUT: &str = "vJrwpWtwJgWrhcsFMMfFFhFp +jqHRNqRjqzjGDLGLrsFMfFZSrLrFZsSL +PmmdzqPrVvPwwTWBwg +wMqvLMZHhHMvwLHjbvcjnnSBnvTQFn +ttgJtRGJQctTZtZT +CrZsJsPPZsGzwwsLwLmpwMDw"; + + #[test] + fn part1() { + let result = process_part1(INPUT); + assert_eq!(result, 157); + } + + #[test] + fn part2() { + let result = process_part2(INPUT); + assert_eq!(result, 70); + } +} diff --git a/y2022/src/days/d4.rs b/y2022/src/days/d4.rs new file mode 100644 index 0000000..3d0f9d1 --- /dev/null +++ b/y2022/src/days/d4.rs @@ -0,0 +1,79 @@ +pub fn process_part1(input: &str) -> i32 { + let result = input + .lines() + .map(|line| { + let (elf1, elf2) = line.split_once(",").unwrap(); + let elf1 = elf1 + .split_once("-") + .map(|(start, end)| start.parse::().unwrap()..=end.parse::().unwrap()) + .unwrap(); + + let elf2 = elf2 + .split_once("-") + .map(|(start, end)| start.parse::().unwrap()..=end.parse::().unwrap()) + .unwrap(); + + if (elf1.contains(elf2.start()) && elf1.contains(elf2.end())) + || (elf2.contains(elf1.start()) && elf2.contains(elf1.end())) + { + return 1; + } + 0 + }) + .sum(); + + result +} + +pub fn process_part2(input: &str) -> i32 { + let result = input + .lines() + .map(|line| { + let (elf1, elf2) = line.split_once(",").unwrap(); + let elf1 = elf1 + .split_once("-") + .map(|(start, end)| start.parse::().unwrap()..=end.parse::().unwrap()) + .unwrap(); + + let elf2 = elf2 + .split_once("-") + .map(|(start, end)| start.parse::().unwrap()..=end.parse::().unwrap()) + .unwrap(); + + if elf1.contains(elf2.start()) + || elf1.contains(elf2.end()) + || elf2.contains(elf1.start()) + || elf2.contains(elf1.end()) + { + return 1; + } + 0 + }) + .sum(); + + result +} + +#[cfg(test)] +mod tests { + use super::*; + + const INPUT: &str = "2-4,6-8 +2-3,4-5 +5-7,7-9 +2-8,3-7 +6-6,4-6 +2-6,4-8"; + + #[test] + fn part1() { + let result = process_part1(INPUT); + assert_eq!(result, 2); + } + + #[test] + fn part2() { + let result = process_part2(INPUT); + assert_eq!(result, 4); + } +} diff --git a/y2022/src/days/d5.rs b/y2022/src/days/d5.rs new file mode 100644 index 0000000..f4d266f --- /dev/null +++ b/y2022/src/days/d5.rs @@ -0,0 +1,110 @@ +fn is_string_numeric(str: &str) -> bool { + for c in str.chars() { + if !c.is_numeric() { + return false; + } + } + true +} + +fn parse_move(crane_move: &str) -> (usize, usize, usize) { + let mut crane_move = crane_move + .split(" ") + .filter(|s| is_string_numeric(s)) + .map(|m| m.parse::().unwrap()); + ( + crane_move.next().unwrap(), + crane_move.next().unwrap() - 1, + crane_move.next().unwrap() - 1, + ) +} + +fn parse_moves(crane_moves: &str) -> Vec<(usize, usize, usize)> { + crane_moves.lines().map(parse_move).collect() +} + +fn parse_stacks(stacks: &str) -> Vec { + let mut lines: Vec<&str> = stacks.lines().collect(); + let mut last_line = lines.pop().unwrap().trim().to_string(); + let num_stacks = last_line.pop().unwrap().to_digit(10).unwrap(); + let mut parsed_stacks = vec!["".to_string(); num_stacks as usize]; + + for line in lines { + for (idx, c) in line.chars().skip(1).step_by(4).enumerate() { + if c.is_alphabetic() { + parsed_stacks[idx].insert(0, c); + } + } + } + parsed_stacks +} + +pub fn process_part1(input: &str) -> String { + let (stacks, crane_moves) = input.split_once("\n\n").unwrap(); + let mut stacks = parse_stacks(stacks); + let crane_moves = parse_moves(crane_moves); + + for (iterations, from, to) in crane_moves { + for _i in 0..iterations { + let popped = stacks[from].pop().unwrap(); + stacks[to].push(popped); + } + } + + let mut result = "".to_string(); + + for mut stack in stacks { + result.push(stack.pop().unwrap()); + } + + result +} + +pub fn process_part2(input: &str) -> String { + let (stacks, crane_moves) = input.split_once("\n\n").unwrap(); + let mut stacks = parse_stacks(stacks); + let crane_moves = parse_moves(crane_moves); + + for (iterations, from, to) in crane_moves { + let from_len = stacks[from].len(); + let from_old = stacks[from].clone(); + let (new_from, popped) = from_old.split_at(from_len - iterations); + stacks[from] = new_from.to_string(); + stacks[to].push_str(popped); + } + + let mut result = "".to_string(); + + for mut stack in stacks { + result.push(stack.pop().unwrap()); + } + + result +} + +#[cfg(test)] +mod tests { + use super::*; + + const INPUT: &str = " [D] +[N] [C] +[Z] [M] [P] + 1 2 3 + +move 1 from 2 to 1 +move 3 from 1 to 3 +move 2 from 2 to 1 +move 1 from 1 to 2"; + + #[test] + fn part1() { + let result = process_part1(INPUT); + assert_eq!(result, "CMZ"); + } + + #[test] + fn part2() { + let result = process_part2(INPUT); + assert_eq!(result, "MCD"); + } +} diff --git a/y2022/src/days/d6.rs b/y2022/src/days/d6.rs new file mode 100644 index 0000000..91789da --- /dev/null +++ b/y2022/src/days/d6.rs @@ -0,0 +1,68 @@ +pub fn process_part1(input: &str) -> i32 { + let mut marker = "".to_string(); + for (idx, c) in input.chars().enumerate() { + if marker.len() == 4 { + return (idx).try_into().unwrap(); + } + if let Some(c_pos) = marker.find(c) { + let (_, new_marker) = marker.split_at(c_pos + 1); + marker = new_marker.to_string(); + } + marker.push(c); + } + 0 +} + +pub fn process_part2(input: &str) -> i32 { + let mut marker = "".to_string(); + for (idx, c) in input.chars().enumerate() { + if marker.len() == 14 { + return (idx).try_into().unwrap(); + } + if let Some(c_pos) = marker.find(c) { + let (_, new_marker) = marker.split_at(c_pos + 1); + marker = new_marker.to_string(); + } + marker.push(c); + } + 0 +} + +#[cfg(test)] +mod tests { + use super::*; + + const INPUT1: &str = "mjqjpqmgbljsphdztnvjfqwrcgsmlb"; + const INPUT2: &str = "bvwbjplbgvbhsrlpgdmjqwftvncz"; + const INPUT3: &str = "nppdvjthqldpwncqszvftbrmjlhg"; + const INPUT4: &str = "nznrnfrfntjfmvfwmzdfjlvtqnbhcprsg"; + const INPUT5: &str = "zcfzfwzzqfrljwzlrfnpqdbhtmscgvjw"; + + #[test] + fn part1() { + let result = process_part1(INPUT1); + assert_eq!(result, 7); + let result = process_part1(INPUT2); + assert_eq!(result, 5); + let result = process_part1(INPUT3); + assert_eq!(result, 6); + let result = process_part1(INPUT4); + assert_eq!(result, 10); + let result = process_part1(INPUT5); + assert_eq!(result, 11); + } + + #[test] + fn part2() { + let result = process_part2(INPUT1); + assert_eq!(result, 19); + let result = process_part2(INPUT2); + assert_eq!(result, 23); + let result = process_part2(INPUT3); + assert_eq!(result, 23); + let result = process_part2(INPUT4); + assert_eq!(result, 29); + let result = process_part2(INPUT5); + assert_eq!(result, 26); + } +} diff --git a/y2022/src/days/d7.rs b/y2022/src/days/d7.rs new file mode 100644 index 0000000..15a88ff --- /dev/null +++ b/y2022/src/days/d7.rs @@ -0,0 +1,200 @@ +use std::collections::HashMap; + +#[derive(Clone, Debug)] +struct Directory { + size: i64, + children: Vec, +} + +fn get_size(dir: Directory, directories: HashMap) -> i64 { + let mut size = dir.size; + if !dir.children.is_empty() { + size += dir + .children + .iter() + .map(|child_name| { + if let Some((_dir_name, child_dir)) = directories.get_key_value(child_name) { + return get_size(child_dir.clone(), directories.clone()); + } + 0 + }) + .sum::(); + } + size +} + +pub fn process_part1(input: &str) -> i64 { + let mut pwd = String::from(""); + let mut directories: HashMap = HashMap::new(); + let lines: Vec> = input + .lines() + .map(|line| line.split_whitespace().collect::>()) + .collect(); + for line in lines { + if line[0] == "$" { + if line[1] == "cd" { + let arg = line[2].to_string(); + match arg.as_str() { + "/" => pwd = arg, + ".." => match pwd.as_str() { + "/" => println!("Already at root"), + _ => pwd.truncate(pwd.rfind("/").unwrap()), + }, + _ => match pwd.as_str() { + "/" => pwd.push_str(&arg), + _ => pwd.push_str(&("/".to_owned() + &arg)), + }, + } + if !directories.contains_key(&pwd) { + directories.insert( + pwd.clone(), + Directory { + size: 0, + children: vec![], + }, + ); + } + } + } else if line[0] == "dir" { + if let Some((dir_name, dir)) = directories.get_key_value(&pwd) { + let mut new_children = dir.children.clone(); + let mut new_child = "/".to_owned() + line[1]; + if pwd != *"/" { + new_child.insert_str(0, &pwd); + } + new_children.push(new_child); + let new_dir = Directory { + size: dir.size, + children: new_children, + }; + directories.insert(dir_name.to_string(), new_dir); + } + } else if line[0] != "dir" { + if let Some((dir_name, dir)) = directories.get_key_value(&pwd) { + let new_dir = Directory { + size: dir.size + line[0].parse::().unwrap(), + children: dir.children.clone(), + }; + directories.insert(dir_name.to_string(), new_dir); + } + } + } + let sizes = directories + .values() + .map(|directory| get_size(directory.clone(), directories.clone())); + + sizes.filter(|size| size <= &100000).sum() +} + +pub fn process_part2(input: &str) -> i64 { + const TOTAL: i64 = 70000000; + const MIN_UNUSED: i64 = 30000000; + let mut pwd = String::from(""); + let mut directories: HashMap = HashMap::new(); + let lines: Vec> = input + .lines() + .map(|line| line.split_whitespace().collect::>()) + .collect(); + for line in lines { + if line[0] == "$" { + if line[1] == "cd" { + let arg = line[2].to_string(); + match arg.as_str() { + "/" => pwd = arg, + ".." => match pwd.as_str() { + "/" => println!("Already at root"), + _ => pwd.truncate(pwd.rfind("/").unwrap()), + }, + _ => match pwd.as_str() { + "/" => pwd.push_str(&arg), + _ => pwd.push_str(&("/".to_owned() + &arg)), + }, + } + if !directories.contains_key(&pwd) { + directories.insert( + pwd.clone(), + Directory { + size: 0, + children: vec![], + }, + ); + } + } + } else if line[0] == "dir" { + if let Some((dir_name, dir)) = directories.get_key_value(&pwd) { + let mut new_children = dir.children.clone(); + let mut new_child = "/".to_owned() + line[1]; + if pwd != *"/" { + new_child.insert_str(0, &pwd); + } + new_children.push(new_child); + let new_dir = Directory { + size: dir.size, + children: new_children, + }; + directories.insert(dir_name.to_string(), new_dir); + } + } else if line[0] != "dir" { + if let Some((dir_name, dir)) = directories.get_key_value(&pwd) { + let new_dir = Directory { + size: dir.size + line[0].parse::().unwrap(), + children: dir.children.clone(), + }; + directories.insert(dir_name.to_string(), new_dir); + } + } + } + let sizes = directories + .values() + .map(|directory| get_size(directory.clone(), directories.clone())); + let unused = TOTAL - sizes.clone().max().unwrap(); + let mut sizes = sizes.collect::>(); + sizes.sort(); + for size in sizes { + if size >= (MIN_UNUSED - unused) { + return size; + } + } + 0 +} + +#[cfg(test)] +mod tests { + use super::*; + + const INPUT: &str = "$ 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"; + + #[test] + fn part1() { + let result = process_part1(INPUT); + assert_eq!(result, 95437); + } + + #[test] + fn part2() { + let result = process_part2(INPUT); + assert_eq!(result, 24933642); + } +} diff --git a/y2022/src/days/d8.rs b/y2022/src/days/d8.rs new file mode 100644 index 0000000..254cabf --- /dev/null +++ b/y2022/src/days/d8.rs @@ -0,0 +1,125 @@ +use std::collections::HashSet; + +fn is_visible_from_line(tree_line: Vec, tree_height: u32) -> bool { + for &tree in tree_line.iter() { + if tree >= tree_height { + return false; + } + } + true +} + +fn is_tree_visible(tree_grid: Vec>, tree_pos: (usize, usize), tree_height: u32) -> bool { + let horizontal_line = tree_grid[tree_pos.0].clone(); + let vertical_line: Vec = tree_grid + .iter() + .map(|horizontal_line| horizontal_line[tree_pos.1]) + .collect(); + + let (left, right) = vertical_line.split_at(tree_pos.0); + let (top, bottom) = horizontal_line.split_at(tree_pos.1); + is_visible_from_line(left.to_vec(), tree_height) + || is_visible_from_line(right[1..].to_vec(), tree_height) + || is_visible_from_line(top.to_vec(), tree_height) + || is_visible_from_line(bottom[1..].to_vec(), tree_height) +} + +pub fn process_part1(input: &str) -> u32 { + let tree_grid = input + .lines() + .map(|line| { + line.chars() + .map(|char| char.to_digit(10).unwrap()) + .collect() + }) + .collect::>>(); + let dimension = (tree_grid.len(), tree_grid[0].len()); + let outer_trees = (dimension.0 as u32 * 2) + (dimension.1 as u32 * 2) - 4; + let mut visible_trees: HashSet<(usize, usize)> = HashSet::new(); + for x in 1..dimension.0 - 1 { + for y in 1..dimension.1 - 1 { + if is_tree_visible(tree_grid.clone(), (x, y), tree_grid[x][y]) { + visible_trees.insert((x, y)); + } + } + } + outer_trees + visible_trees.len() as u32 +} + +fn seeing_distance(tree_line: Vec, tree_height: u32) -> u32 { + let mut count = 0; + for tree in tree_line { + count += 1; + if tree >= tree_height { + break; + } + } + count +} + +fn calc_score(tree_grid: Vec>, tree_pos: (usize, usize), tree_height: u32) -> u32 { + let horizontal_line = tree_grid[tree_pos.0].clone(); + let vertical_line: Vec = tree_grid + .iter() + .map(|horizontal_line| horizontal_line[tree_pos.1]) + .collect(); + + let (left, right) = vertical_line.split_at(tree_pos.0); + let mut left = left.to_vec(); + left.reverse(); + let (top, bottom) = horizontal_line.split_at(tree_pos.1); + let mut top = top.to_vec(); + top.reverse(); + seeing_distance(left.to_vec(), tree_height) + * seeing_distance(right[1..].to_vec(), tree_height) + * seeing_distance(top.to_vec(), tree_height) + * seeing_distance(bottom[1..].to_vec(), tree_height) +} + +pub fn process_part2(input: &str) -> u32 { + let tree_grid = input + .lines() + .map(|line| { + line.chars() + .map(|char| char.to_digit(10).unwrap()) + .collect() + }) + .collect::>>(); + let dimension = (tree_grid.len(), tree_grid[0].len()); + let mut highest_score = 0; + for x in 1..dimension.0 - 1 { + for y in 1..dimension.1 - 1 { + if is_tree_visible(tree_grid.clone(), (x, y), tree_grid[x][y]) { + let score = calc_score(tree_grid.clone(), (x, y), tree_grid[x][y]); + if score > highest_score { + highest_score = score; + } + } + } + } + highest_score +} + +#[cfg(test)] +mod tests { + use super::*; + + const INPUT: &str = "30373 +25512 +65332 +33549 +35390 +"; + + #[test] + fn part1() { + let result = process_part1(INPUT); + assert_eq!(result, 21); + } + + #[test] + fn part2() { + let result = process_part2(INPUT); + assert_eq!(result, 8); + } +} diff --git a/y2022/src/days/d9.rs b/y2022/src/days/d9.rs new file mode 100644 index 0000000..582db82 --- /dev/null +++ b/y2022/src/days/d9.rs @@ -0,0 +1,229 @@ +use std::collections::HashSet; + +#[derive(Clone, Copy, Debug)] +enum Move { + Up(i32), + Down(i32), + Left(i32), + Right(i32), +} + +#[derive(Clone)] +struct Position { + head: (i32, i32), + tail: (i32, i32), + visited_positions: HashSet<(i32, i32)>, +} + +impl Position { + fn new() -> Position { + Position { + head: (0, 0), + tail: (0, 0), + visited_positions: HashSet::from([(0, 0)]), + } + } + + fn is_touching(&self) -> bool { + if self.head == self.tail { + return true; + } + if self.head.0.abs_diff(self.tail.0) <= 1 && self.head.1.abs_diff(self.tail.1) <= 1 { + return true; + } + false + } + + fn update(&mut self, movement: Move) { + match movement { + Move::Up(distance) => { + for _ in 1..=distance { + self.step(Move::Up(1)); + } + } + Move::Down(distance) => { + for _ in 1..=distance { + self.step(Move::Down(1)); + } + } + Move::Left(distance) => { + for _ in 1..=distance { + self.step(Move::Left(1)); + } + } + Move::Right(distance) => { + for _ in 1..=distance { + self.step(Move::Right(1)); + } + } + } + } + + fn square(a: i32) -> i32 { + a * a + } + + fn get_distance(point_a: (i32, i32), point_b: (i32, i32)) -> f64 { + (Self::square(point_b.0 - point_a.0) as f64 + Self::square(point_b.1 - point_a.1) as f64) + .sqrt() + } + + fn move_tail(&mut self, movement: Move) { + let big_distance = Self::get_distance(self.head, self.tail) > 2f64.sqrt(); + if !&self.is_touching() { + match movement { + Move::Up(_) => { + self.tail.0 = self.head.0 - 1; + if big_distance { + self.tail.1 -= 1; + } else { + self.tail.1 = self.head.1; + } + } + Move::Down(_) => { + self.tail.0 = self.head.0 + 1; + if big_distance { + self.tail.1 += 1; + } else { + self.tail.1 = self.head.1; + } + } + Move::Left(_) => { + self.tail.1 = self.head.1 + 1; + if big_distance { + self.tail.0 += 1; + } else { + self.tail.0 = self.head.0; + } + } + Move::Right(_) => { + self.tail.1 = self.head.1 - 1; + if big_distance { + self.tail.0 -= 1; + } else { + self.tail.0 = self.head.0; + } + } + } + } + self.visited_positions.insert(self.tail); + } + + fn step(&mut self, movement: Move) { + match movement { + Move::Up(distance) => self.head.0 += distance, + Move::Down(distance) => self.head.0 -= distance, + Move::Left(distance) => self.head.1 -= distance, + Move::Right(distance) => self.head.1 += distance, + } + self.move_tail(movement); + } +} + +fn parse_line(line: &str) -> Move { + let mut line = line.split_whitespace(); + let direction = line.next(); + let distance = line.next().unwrap().parse::().unwrap(); + match direction { + Some("U") => Move::Up(distance), + Some("D") => Move::Down(distance), + Some("L") => Move::Left(distance), + Some("R") => Move::Right(distance), + _ => panic!("Shouldn_t happen"), + } +} + +pub fn process_part1(input: &str) -> usize { + let mut position = Position { + head: (0, 0), + tail: (0, 0), + visited_positions: HashSet::from([(0, 0)]), + }; + let moves = input.lines().map(parse_line); + for movement in moves { + position.update(movement); + } + position.visited_positions.len() +} +pub fn process_part2(input: &str) -> usize { + let mut positions = vec![Position::new(); 10]; + let moves = input.lines().map(parse_line); + for movement in moves { + let mut steps = 0; + if let Move::Up(distance) = movement { + steps = distance; + } else if let Move::Down(distance) = movement { + steps = distance; + } else if let Move::Left(distance) = movement { + steps = distance; + } else if let Move::Right(distance) = movement { + steps = distance; + } + for _ in 0..steps { + for (idx, position) in positions.clone().iter().enumerate() { + let mut position = position.clone(); + if idx == 0 { + match movement { + Move::Up(_) => { + position.step(Move::Up(1)); + } + Move::Down(_) => { + position.step(Move::Down(1)); + } + Move::Left(_) => { + position.step(Move::Left(1)); + } + Move::Right(_) => { + position.step(Move::Right(1)); + } + } + println!("head: {:?}", position.head) + } else { + position.head = positions[idx - 1].tail; + position.move_tail(movement); + println!("knot nr{}: {:?}", idx, position.head); + } + if idx == 9 { + println!("tail: {:?}", position.tail) + } + positions[idx] = position; + } + } + } + positions[9].visited_positions.len() +} + +#[cfg(test)] +mod tests { + use super::*; + + const INPUT1: &str = "R 4 +U 4 +L 3 +D 1 +R 4 +D 1 +L 5 +R 2"; + + const INPUT2: &str = "R 5 +U 8 +L 8 +D 3 +R 17 +D 10 +L 25 +U 20"; + + #[test] + fn part1() { + let result = process_part1(INPUT1); + assert_eq!(result, 13); + } + + #[test] + fn part2() { + let result = process_part2(INPUT2); + assert_eq!(result, 36); + } +} diff --git a/y2022/src/days/mod.rs b/y2022/src/days/mod.rs new file mode 100644 index 0000000..68906bd --- /dev/null +++ b/y2022/src/days/mod.rs @@ -0,0 +1,9 @@ +pub mod d1; +pub mod d2; +pub mod d3; +pub mod d4; +pub mod d5; +pub mod d6; +pub mod d7; +pub mod d8; +pub mod d9; diff --git a/y2022/src/lib.rs b/y2022/src/lib.rs new file mode 100644 index 0000000..c73659c --- /dev/null +++ b/y2022/src/lib.rs @@ -0,0 +1 @@ +pub mod days; diff --git a/y2023/Cargo.toml b/y2023/Cargo.toml new file mode 100644 index 0000000..0f57c4c --- /dev/null +++ b/y2023/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "y2023" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/y2023/src/lib.rs b/y2023/src/lib.rs new file mode 100644 index 0000000..e69de29 diff --git a/y2024/Cargo.toml b/y2024/Cargo.toml new file mode 100644 index 0000000..28f363e --- /dev/null +++ b/y2024/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "y2024" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/y2024/src/lib.rs b/y2024/src/lib.rs new file mode 100644 index 0000000..e69de29