From 8fcee096b6e57a7b816d34285e693b88464b2689 Mon Sep 17 00:00:00 2001 From: texhno Date: Tue, 5 Dec 2023 11:52:53 +0100 Subject: [PATCH] Initial commit --- .gitignore | 1 + 2022/data/day01.example1.txt | 14 + 2022/data/day01.txt | 2236 +++++++++++++++++++++++++++++ 2022/data/day02.example1.txt | 3 + 2022/typescript/day01/d01p1.ts | 10 + 2022/typescript/day01/d01p2.ts | 12 + 2022/typescript/day01/index.ts | 4 + 2022/typescript/package-lock.json | 220 +++ 2022/typescript/package.json | 18 + 2022/typescript/runner.ts | 13 + 2022/typescript/tsconfig.json | 109 ++ 2023/data/day01.example1.txt | 4 + 2023/data/day01.example2.txt | 7 + 2023/data/day01.example3.txt | 15 + 2023/data/day01.txt | 1000 +++++++++++++ 2023/typescript/day01/d01p1.ts | 9 + 2023/typescript/day01/d01p2.ts | 9 + 2023/typescript/day01/index.ts | 4 + 2023/typescript/package-lock.json | 230 +++ 2023/typescript/package.json | 19 + 2023/typescript/runner.ts | 13 + 2023/typescript/tsconfig.json | 109 ++ README.md | 20 + lib/typescript/combinators.ts | 10 + lib/typescript/fileReader.ts | 5 + lib/typescript/helpers.ts | 16 + lib/typescript/logger.ts | 5 + lib/typescript/parsers.ts | 32 + lib/typescript/reducers.ts | 5 + lib/typescript/regExp.ts | 10 + scripts/mkday | 39 + templates/typescript/dXXp1.txt | 6 + templates/typescript/dXXp2.txt | 6 + templates/typescript/index.txt | 4 + 34 files changed, 4217 insertions(+) create mode 100644 .gitignore create mode 100644 2022/data/day01.example1.txt create mode 100644 2022/data/day01.txt create mode 100644 2022/data/day02.example1.txt create mode 100644 2022/typescript/day01/d01p1.ts create mode 100644 2022/typescript/day01/d01p2.ts create mode 100644 2022/typescript/day01/index.ts create mode 100644 2022/typescript/package-lock.json create mode 100644 2022/typescript/package.json create mode 100644 2022/typescript/runner.ts create mode 100644 2022/typescript/tsconfig.json create mode 100644 2023/data/day01.example1.txt create mode 100644 2023/data/day01.example2.txt create mode 100644 2023/data/day01.example3.txt create mode 100644 2023/data/day01.txt create mode 100644 2023/typescript/day01/d01p1.ts create mode 100644 2023/typescript/day01/d01p2.ts create mode 100644 2023/typescript/day01/index.ts create mode 100644 2023/typescript/package-lock.json create mode 100644 2023/typescript/package.json create mode 100644 2023/typescript/runner.ts create mode 100644 2023/typescript/tsconfig.json create mode 100644 README.md create mode 100644 lib/typescript/combinators.ts create mode 100644 lib/typescript/fileReader.ts create mode 100644 lib/typescript/helpers.ts create mode 100644 lib/typescript/logger.ts create mode 100644 lib/typescript/parsers.ts create mode 100644 lib/typescript/reducers.ts create mode 100644 lib/typescript/regExp.ts create mode 100755 scripts/mkday create mode 100644 templates/typescript/dXXp1.txt create mode 100644 templates/typescript/dXXp2.txt create mode 100644 templates/typescript/index.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/2022/data/day01.example1.txt b/2022/data/day01.example1.txt new file mode 100644 index 0000000..2094f91 --- /dev/null +++ b/2022/data/day01.example1.txt @@ -0,0 +1,14 @@ +1000 +2000 +3000 + +4000 + +5000 +6000 + +7000 +8000 +9000 + +10000 diff --git a/2022/data/day01.txt b/2022/data/day01.txt new file mode 100644 index 0000000..1f757be --- /dev/null +++ b/2022/data/day01.txt @@ -0,0 +1,2236 @@ +7896 +4992 +1382 +2920 +7533 +2709 +6020 +5321 +2698 +6806 +8008 + +1340 +1472 +7147 +2707 +5491 +7003 +2337 +1401 +5309 +4385 +2805 + +6019 +1924 +8917 +6303 +9358 +3640 +1563 +1902 + +10946 +10333 +8504 +6110 +10157 + +4578 +1711 +3343 +6159 +4045 +3487 +3070 +5663 +3518 +5839 +5911 +4970 +4852 +4512 + +4277 +3324 +6172 +8272 +2707 +3292 +6599 +1204 +7030 +3075 + +6907 +5595 +10251 +8654 +4036 +11545 + +16787 +11035 +12217 + +2196 +1519 +5810 +6837 +1193 +6480 +1237 +1659 +4323 +2896 +3878 +2894 + +15886 +20356 +23636 + +8795 +7986 +14228 +15738 +13503 + +6598 +17951 +17508 +2446 + +1382 +3232 +6467 +2791 +6250 +2704 +3898 +5569 +8676 + +2582 +8767 +3195 +7957 +6614 + +24737 +34912 + +28868 +34308 + +2703 +20947 + +5548 +5930 +6705 +4227 +6120 +8723 +4597 + +5877 +1223 +5789 +2207 +3488 +5210 +3056 +4300 +3880 +1826 +5366 +4531 +2016 +5304 + +4226 +5314 +6437 +1737 +1229 +3757 +5128 +1058 +5940 +3344 +5188 +4963 +1403 +5498 + +4969 +3096 +7035 +2695 +4747 +5109 +6294 +7990 +1539 +2608 +2944 + +14127 +9751 +4842 +1106 +2779 + +11896 +6643 +15874 +10487 +4141 + +4696 +6644 +6285 +4321 +4080 +6888 +5213 +5048 +6545 +5848 +1690 +5351 +2560 + +17296 +4277 +8327 +7931 + +8374 +3794 +5435 +6968 +4768 +3458 + +5090 +5614 +9448 +10331 +1311 +12604 + +5126 +4860 +1299 +6934 +11746 +2628 +12132 + +6648 +8567 +10219 +2385 +3642 +10478 +7662 + +9206 +2176 +6472 +12314 + +7006 +9478 +2742 +12074 +11993 +3221 + +2458 +4271 +6417 +13749 +5411 + +7826 +4566 +10845 +4535 +5673 +8305 + +8264 +11302 +7040 +9481 +9935 +6624 +8376 + +10460 +20936 + +3456 +3498 +6808 +7408 +5543 +3673 +6672 +6650 +7560 +2477 +6505 + +6943 +3217 +6235 +5079 +1386 +3453 +1736 +4569 +1422 +2804 +5807 + +2241 +1925 +3348 +4805 +2575 +3656 +1379 +5628 +2348 +4652 +5052 +5788 +4128 +2160 + +4839 +3854 +3192 +4055 +1892 +5418 +6415 +1645 +1609 +3844 +3097 +2117 +4043 + +6996 +16021 +23549 + +5493 +5824 +7101 +5017 +8221 +5407 +1963 +6083 + +4896 +18916 +17584 +19464 + +2897 +1198 +1847 +4416 +3086 +2006 +1743 +1387 +3390 +1416 +4713 +3831 +2789 +5146 +2220 + +9452 +8265 +6453 +2831 +3803 +1928 +1047 +5087 +9454 + +2885 +1518 +5218 +2629 +5204 +3715 +4468 +4399 +3020 +5194 +5361 +4566 +5875 +3995 +3081 + +5435 +3159 +1378 +1333 +4491 +5405 +4858 +3744 +5468 +2313 +3014 +2236 + +7027 +5112 +6675 +1149 +5519 +7197 +5210 +3811 +1259 +3794 +2700 +6518 + +6066 +2040 +1948 +2972 +3816 +1477 +4477 +3085 +4169 +1245 +5008 +2016 +4449 +1544 +1511 + +5909 +3378 +12050 +6988 +11093 +8034 +2552 + +5647 +7225 +1416 +4531 +2148 +5176 +1086 +1268 +3907 + +8824 +12672 +6094 +4105 + +9982 +1255 +5102 +2060 +8348 +8610 +9019 + +6442 +8353 +2849 +6823 +5061 +8540 + +1020 +4819 +2371 +6452 +2589 +2140 +3018 +6422 +2079 +1049 +4183 +1959 +6889 + +3370 +20341 +6283 + +3568 +8914 +2474 +1840 +1092 +2901 +4619 + +5489 +5048 +2151 +1275 +4555 +6105 +6393 +5439 +1175 +3143 +1039 +6159 +4280 + +25302 +11104 + +16342 +19486 +6818 +5872 + +4287 +7300 +5106 +6009 +5397 +4743 +8786 +5374 +7723 +3342 + +7830 +4687 +3639 +5942 +8019 +7531 +4763 +8086 + +2928 +12662 +1729 +15599 +7031 + +4504 +8351 +3310 +2860 +7474 +1052 +7088 +7300 +7653 + +3800 +3285 +2244 +6146 +1527 +2496 +3373 +2935 +4073 +2708 +5854 +4532 +4265 + +38782 + +3895 +2886 +3397 +10665 +7954 +5994 + +3830 +4381 +4042 +3631 +2109 +2742 +2748 +1117 +2772 +1921 +4357 +2960 +4504 +6021 +2300 + +5684 +30508 + +5467 +4827 +7991 +4299 +4152 +7070 +1911 +1345 +5607 +6490 +5631 + +2288 +4534 +1402 +2221 +2137 +4623 +5745 +1848 +1638 +2562 +1095 +2539 +4090 +3929 +4330 + +3776 +11693 +1189 +2039 +2662 +11224 +9212 + +3778 +1619 +4008 +1706 +1926 +3844 +5194 +3554 +6272 +2988 +4779 +5481 +1443 +6297 + +1712 +6076 +7332 +5267 +6685 +2555 +4517 +8692 +1819 + +23640 +10894 +25482 + +10592 +9277 +1228 +1197 +9162 +4838 +3783 +2691 + +15579 +16090 +5228 +4273 +5288 + +4044 +10911 +4767 +8658 +5775 +9369 +5332 + +8063 +4322 +5109 +6744 +5653 +9544 +2610 +2241 + +3885 +1140 +10508 +11910 +6096 + +7234 +15371 +10892 +15338 +12191 + +3698 +3413 +3783 +3362 +1828 +1302 +3426 +3147 +5558 +2644 +3636 +5842 +5261 +3312 +3164 + +3088 +1303 +2194 +5841 +5330 +5986 +4108 +4571 +7161 +6276 +5920 +5011 + +6546 +30555 + +5922 +2401 +4792 +7175 +7942 +5040 +3601 +2213 +6802 +2244 +6891 + +2694 +7905 +6046 +3782 +5591 +3665 +4195 +4579 +4300 +1822 + +6308 +2993 +5663 +4780 +6638 +6503 +6307 +4682 +7281 +4580 +7441 +5611 + +9706 +4619 +2108 +8345 +2422 +12140 +9146 + +4984 +10121 +4062 +3797 +5130 +1641 +11492 + +7592 +9412 +5474 +7809 +8073 +2056 +3839 +3557 + +7893 +3556 +9427 +2836 +10256 + +4410 +3041 +2124 +5830 +4200 +4102 +5146 +3355 +4318 +5422 +4992 +1979 +2696 +5277 +4058 + +13134 +35366 + +5363 +1706 +4925 +5967 +8514 +3362 +1424 +4427 +8906 + +2891 +4388 +10112 +3409 +2477 +1138 +3790 +4712 + +9130 +4622 +9723 +4660 +2778 +1083 +2326 +9254 + +3221 +4739 +3752 +1220 +10337 +1159 +2367 +1900 + +2038 +5545 +5904 +5378 +4334 +2897 +5745 +3670 +4773 +3087 +5760 +4026 +3719 +3084 + +8674 +8656 +4162 +5125 +4183 +3496 +7379 +6150 +5225 +8014 + +10321 +16081 +6163 +2030 + +31755 +18352 + +1666 +15493 +8858 +15689 + +1903 +7006 +9002 +5067 +9397 +8703 +7534 +8188 +4983 + +4398 +12055 +6820 +2412 +10308 +11231 + +5914 +9582 +4568 +7679 +5867 +5798 +2955 +7834 +1833 + +2554 +1886 +4590 +3753 +3161 +4039 +2435 +1172 +2690 +4564 +5160 +3715 +2834 +6074 +1251 + +9837 +4501 +3669 +7682 +2762 +6072 +8731 +2324 + +7030 +6956 +3040 +2185 +4717 +2907 +5255 +1194 +1309 +5100 +5630 +5164 + +18808 +5780 +13062 +16131 + +5436 +13758 +12390 +14884 + +5344 +3178 +1907 +6945 +6435 +3985 +3637 +6984 +2108 +2282 + +6870 +3774 +4149 +3361 +3208 +3696 +4265 +2295 +7068 +4365 +6729 + +9828 +3819 +7654 +2391 +11354 +6751 + +5409 +6025 +6772 +4005 +6894 +2723 +2485 +5866 +5744 +1804 +2509 +3285 +5663 + +6630 +7966 +6366 +2854 +3478 +6566 +3790 +4047 +8471 +5911 + +5930 +4813 +10365 +1430 + +13119 +11915 +4732 +9949 +13699 +9790 + +3413 +3027 +5513 +3320 +4421 +2507 +5781 +2622 +5472 +6590 +2021 +2164 +4106 + +49386 + +3656 +7422 +6157 +5982 +3944 +5726 +2628 +6618 +6138 +2186 +4744 + +33805 + +9976 +4213 +4359 +3723 + +4106 +1423 +3334 +5115 +3819 +1308 +2652 +5954 +4439 +2188 +3415 +1104 +2973 +1681 +4704 + +64085 + +1097 +4369 +3803 +3247 +5135 +6928 +3419 +2418 +5130 +2555 +3043 + +4831 +2425 +2023 +1667 +6410 +6422 +5851 +4966 +6721 +5312 +3792 +6700 +1545 + +1742 +5176 +8587 +9261 +15254 + +3097 +6016 +5558 +3004 +4372 +1986 +5576 +6105 +1709 +1326 +4997 +5528 +2823 +3072 + +1228 +2891 +3056 +5874 +2267 +2232 +1754 +3979 +1881 +6633 +1889 +5506 +4377 + +3703 +6310 +1020 +4891 +4911 +2913 +3888 +4642 +1963 +3716 +2222 +4528 +1030 +6081 + +10172 +1472 +6212 +9125 +9365 +7866 +3525 +4752 + +2546 +2326 +5739 +1010 +4724 +5324 +2495 +2999 +5272 +1937 +4396 +6333 +3632 + +2944 +1285 +3457 +1980 +2346 +5712 +5088 +3718 +2036 +6725 + +4335 +5577 +4533 +3275 +4297 +2774 +5029 + +1396 +5993 +4058 +1095 +4388 +1843 +1643 +6192 +2801 +2583 +4286 +5483 +2308 +1577 + +1584 +7552 +8133 +9503 +1989 + +4584 +7691 +4707 +5757 +2519 +2097 +1460 +6651 +3569 +1159 + +9366 +3998 +2020 +2598 +2166 +3298 +6533 +1323 + +10007 +2282 +10952 +3217 +8819 +7164 + +3095 +1126 +1893 +1540 +3172 +2310 +2566 +2438 +4431 +3423 +6675 + +4131 +9513 +11678 +5248 +7769 +3887 +3494 + +5382 +1013 +4021 +7366 +12330 +13746 + +3536 +4407 +1205 +6210 +1388 +6202 +5314 +3286 +6888 +3049 +3946 +3684 +4187 + +1934 +1285 +3262 +4136 +5790 +1340 +2597 +2992 +3008 +5698 +3688 +3086 +2459 +2413 +4769 + +2150 +1030 +3068 +3747 +5417 +4237 +3311 +5081 +4846 +5555 +4650 +3830 +2209 +3069 + +9935 +9564 +15110 + +3038 +2079 +1059 +4905 +4104 +3502 +6338 +1366 +5990 +6073 +4692 +4706 +3474 +3469 + +5845 +1176 +5553 +4578 +3868 +6154 +4799 +5079 +5927 +4185 +1806 +4449 +6248 + +1280 +2823 +1372 +5899 +2547 +5738 +1545 +1046 +2917 +4931 +6094 +3690 +5021 +4657 +1214 + +3046 +4952 +1138 +2373 +1412 +4848 +5772 +4750 +4741 +5752 +5977 +5270 +5526 +3509 +1793 + +3228 +9849 +11815 +6507 +10144 +4756 + +5119 +1764 +1718 +4813 +3662 +4731 +2755 +1315 +1975 +5716 +4859 +4748 +4809 +1296 +1689 + +2909 +7209 +6124 +3235 +4089 +1271 +6220 +10328 + +5630 +10237 +5572 +1065 +2126 +7181 + +32487 +2379 + +2718 +4228 +7834 +6711 +7619 +6321 +1080 +8584 +6860 +6542 + +5106 +8514 +6109 +1204 +5159 +7935 +7292 +8114 + +5898 +4837 +6825 +4587 +1021 +5713 +4862 +3864 +2022 +1129 +4444 +6439 +4369 + +8875 +7916 +2177 +2085 +8103 +7908 +6266 +9099 + +23274 +30650 + +5537 +21092 +21841 + +5852 +9025 +4459 +4883 +2577 +4679 +5673 +1548 +6726 + +4034 +2542 +15179 +6499 +3472 + +2228 +5558 +7863 +5080 +6441 +2064 +1676 +8473 + +18854 +5610 +18471 + +1196 +3063 +13221 +19006 + +37369 +24756 + +4271 +6806 +6381 +6363 +5221 +5729 +3829 +7832 +1150 +3352 +3210 + +1422 +2606 +6070 +4950 +4300 +4023 +1862 +5027 +5668 +5058 +3969 +2359 +5394 +6001 + +12165 +13318 +11945 +12507 +11398 + +9539 +8607 +7451 +11189 +11056 +3209 + +5845 +2759 +4046 +3838 +2768 +1168 +1237 +6370 +3384 +3938 +3946 +5028 +2603 + +20671 +8067 +7232 + +7376 +3530 +3343 +4917 +6712 +5080 +5846 +2774 +3020 +5738 +5500 + +5185 +2455 +6887 +7349 +1917 +2435 +2458 +3676 +1783 +8567 + +5585 +3750 +2664 +6867 +1506 +6830 +1279 +7877 +2757 +4091 +2731 + +11132 + +6128 +2421 +5519 +4390 +6457 +2769 +1410 +3365 +5682 +5685 +1502 +3245 + +1265 +7559 +8923 +1805 +9738 +3780 +9131 + +3052 +5440 +1672 +3462 +1053 +2902 +2137 +5053 +4905 +3544 +4374 +2718 +5799 + +24868 +18500 +13495 + +4653 +5142 +2117 +2908 +2324 +4335 +1096 +6733 +2380 +5352 +1830 +1893 +2491 + +3142 +4111 +4577 +6019 +1075 +2596 +4950 +5814 +5880 +5573 +3672 +2623 +5602 +1032 +5599 + +7365 +2959 +6303 +6111 +4607 +6530 +4873 +4367 +3776 + +16700 +7439 +4758 +6160 + +4203 +1817 +2941 +5662 +1387 +1698 +3031 +3718 +6087 +4971 +5592 +4460 +5271 +3867 +4998 + +22671 +4704 +23657 + +5028 +5059 +4212 +1200 +2284 +6082 +4589 +4383 +4682 +1243 +6449 +1380 +4515 + +10431 +11132 +13078 +3070 +8963 +1329 + +3931 +6924 +5760 +2448 +4709 +13742 + +4493 +4759 +5130 +5004 +7898 +8508 +6718 +2769 +5103 +4254 + +2261 +4383 +1602 +3767 +4634 +3704 +4242 +6316 +5351 +3531 +3470 +3904 + +3541 +2879 +1596 +4477 +1209 +2089 +4365 +4813 +1830 +1069 +2994 +6076 +3379 +4130 +4102 + +11774 +16285 +15432 + +1364 +3558 +5162 +4115 +2730 +3464 +2673 +4541 +5020 +5299 +3199 +3221 +4372 + +2696 +2080 +4206 +1901 +6091 +4955 +2674 +2184 +4977 +4339 +1011 +3766 +5911 +5316 +3703 + +21030 + +6714 +3093 +1168 +1507 +5134 +6516 +1572 +8383 + +5080 +7055 +6559 +4514 +7036 +7348 +5836 +2223 +1996 +4888 +3666 + +25117 +18822 + +2855 +4165 +4812 +8068 +6471 +4447 +4482 +4775 +1002 + +5999 +5674 +4022 +7403 +5593 +6164 +5109 +6856 +3449 +1689 +3727 +2115 + +5781 +4639 +3684 +4010 +4018 +1004 +3081 +1003 +1702 +1457 +1301 +2122 +2014 +5790 + +6373 +1849 +4389 +5772 +4888 +7981 +4238 +1476 +5550 +2922 + +1513 +8603 +5489 +6664 +4505 +7378 +4185 +8087 +6799 + +6482 +3622 +5516 +6214 +6243 +6214 +4711 +3038 +3398 +5483 +3145 +3536 + +9125 +5549 +8576 +5240 +6032 +7952 +5140 +7580 + +6079 +2048 +4407 +5706 +2535 +4588 +5182 +3204 +5287 +5221 +2457 +6932 +4174 + +5505 +1576 +13849 +5436 +2535 +3865 + +2178 +5420 +1013 +6435 +3810 +2903 +5079 +4332 +6257 +1344 +4511 +3127 +6464 + +3805 +2215 +1614 +2501 +1067 +1874 +6199 +1733 +2146 +6581 +3514 +1175 +1099 + +6473 +3376 +4934 +5773 +4970 +7229 +5716 +1014 +7507 +6012 + +3636 +3377 +5729 +2413 +6252 +3314 +2928 +2317 +1157 +2788 +3842 +3906 +4650 +5338 + +5103 +2724 +3794 +1431 +5838 +3971 +2107 +6475 +1746 +5986 +3736 +6345 +4124 +5664 + +3774 +2420 +1478 +2100 +2608 +1168 +1584 +1266 +1346 +1262 +6217 +6392 +2148 +4525 + +3294 +14112 +2438 +13482 +4287 + +10170 +4078 +4238 +3724 +8472 +9110 +5386 +3743 + +10397 +11155 +4476 +7990 +8374 +3340 +4575 + +27723 + +7777 +9699 +8470 +1721 +7728 +1288 +4458 +3428 + +12000 +5191 +8549 +9184 +3081 +11587 +9430 + +13626 +2596 +12534 +7672 +5161 +1160 + +7830 +3505 +7940 +4756 +6977 +3085 +2639 +6439 +4919 +1421 +5196 + +2714 +1424 +7020 +8593 +1436 +7652 +1146 +4168 +2069 +5958 + +38215 + +1436 +6327 +10725 +4280 +4509 +10301 +5183 +5166 + +6068 +8243 +6171 +5575 +9093 +6123 +2831 +5664 +6278 + +4093 +4619 +2578 +5902 +1131 +3288 +4886 +4994 +6088 +6377 +1852 +4254 +1419 +1504 + +7127 +8649 +2523 +8023 +3063 +2677 +1759 +8632 +7805 +2999 + +3419 +1111 +5599 +1055 +3407 +4964 +3556 +7249 +1100 +7148 +1852 +1549 + +5414 +11474 +1685 +8818 +10288 +6138 +1983 + +23129 +2195 + +3104 +1599 +2327 +3640 +2230 +2791 +2344 +1035 +1046 +3399 +5096 +1067 +1987 +5786 +1395 + +32647 +10609 + +6020 +2279 +8718 +3103 +7022 +6464 +6180 +3968 +3275 + +3221 +5381 +6110 +1860 +4557 +4705 +3658 +4172 +5002 +5578 +1355 +4114 +3501 +4821 + +1312 +1921 +2644 +5044 +3336 +4520 +1253 +3184 +3732 +6754 +2139 diff --git a/2022/data/day02.example1.txt b/2022/data/day02.example1.txt new file mode 100644 index 0000000..db60e36 --- /dev/null +++ b/2022/data/day02.example1.txt @@ -0,0 +1,3 @@ +A Y +B X +C Z diff --git a/2022/typescript/day01/d01p1.ts b/2022/typescript/day01/d01p1.ts new file mode 100644 index 0000000..6c60684 --- /dev/null +++ b/2022/typescript/day01/d01p1.ts @@ -0,0 +1,10 @@ +import { mapR, pipe, sum } from "../../../lib/typescript/reducers"; +import { blocks, lines, strToNum, getMax } from "../../../lib/typescript/helpers"; + +export const solve = pipe( + blocks, + mapR(lines), + mapR(mapR(strToNum)), + mapR(sum), + getMax, +); diff --git a/2022/typescript/day01/d01p2.ts b/2022/typescript/day01/d01p2.ts new file mode 100644 index 0000000..a5e1a95 --- /dev/null +++ b/2022/typescript/day01/d01p2.ts @@ -0,0 +1,12 @@ +import { mapR, pipe, sum } from "../../../lib/typescript/reducers"; +import { blocks, lines, strToNum, sortDesc, take } from "../../../lib/typescript/helpers"; + +export const solve = pipe( + blocks, + mapR(lines), + mapR(mapR(strToNum)), + mapR(sum), + sortDesc, + take(3), + sum, +); diff --git a/2022/typescript/day01/index.ts b/2022/typescript/day01/index.ts new file mode 100644 index 0000000..fa41326 --- /dev/null +++ b/2022/typescript/day01/index.ts @@ -0,0 +1,4 @@ +import { solve as part1 } from "./d01p1"; +import { solve as part2 } from "./d01p2"; + +export { part1, part2 }; diff --git a/2022/typescript/package-lock.json b/2022/typescript/package-lock.json new file mode 100644 index 0000000..ec095b0 --- /dev/null +++ b/2022/typescript/package-lock.json @@ -0,0 +1,220 @@ +{ + "name": "typescript", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "typescript", + "version": "1.0.0", + "license": "ISC", + "devDependencies": { + "@types/node": "^20.10.2", + "ts-node": "^10.9.1", + "tslib": "^2.6.2", + "typescript": "^5.3.2" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", + "dev": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.10.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.2.tgz", + "integrity": "sha512-37MXfxkb0vuIlRKHNxwCkb60PNBpR94u4efQuN4JgIAm66zfCDXGSAFCef9XUWFovX2R1ok6Z7MHhtdVXXkkIw==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/acorn": { + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz", + "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.0.tgz", + "integrity": "sha512-FS7hV565M5l1R08MXqo8odwMTB02C2UqzB17RVgu9EyuYFBqJZ3/ZY97sQD5FewVu1UyDFc1yztUDrAwT0EypA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "node_modules/ts-node": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", + "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, + "node_modules/typescript": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.2.tgz", + "integrity": "sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "engines": { + "node": ">=6" + } + } + } +} diff --git a/2022/typescript/package.json b/2022/typescript/package.json new file mode 100644 index 0000000..db9ff08 --- /dev/null +++ b/2022/typescript/package.json @@ -0,0 +1,18 @@ +{ + "name": "typescript", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "@types/node": "^20.10.2", + "ts-node": "^10.9.1", + "tslib": "^2.6.2", + "typescript": "^5.3.2" + } +} diff --git a/2022/typescript/runner.ts b/2022/typescript/runner.ts new file mode 100644 index 0000000..17b9bf8 --- /dev/null +++ b/2022/typescript/runner.ts @@ -0,0 +1,13 @@ +import { report } from "../../lib/typescript/logger"; +import { readFIleToString as getInput } from "../../lib/typescript/fileReader"; + +const MIN_ARGS = 3; + +(async () => { + if (process.argv.length < MIN_ARGS) console.log(`Usage: cmd [fName]\nOr: cmd [fName] -e`); + + const { part1, part2 } = await import(`../typescript/${process.argv[2]}`); + const input = getInput( `../data/${process.argv[2]}${/-e\d/gi.exec(process.argv[3]) ? `.example${process.argv[3][2]}` : ""}.txt`) + + report(part1(input), part2(input)); +})(); diff --git a/2022/typescript/tsconfig.json b/2022/typescript/tsconfig.json new file mode 100644 index 0000000..e075f97 --- /dev/null +++ b/2022/typescript/tsconfig.json @@ -0,0 +1,109 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + + /* Language and Environment */ + "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "jsx": "preserve", /* Specify what JSX code is generated. */ + // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ + // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ + // "types": [], /* Specify type package names to be included without being referenced in a source file. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ + // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ + // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ + // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ + // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ + // "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ + + /* JavaScript Support */ + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ + // "outDir": "./", /* Specify an output folder for all emitted files. */ + // "removeComments": true, /* Disable emitting comments. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ + + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + } +} diff --git a/2023/data/day01.example1.txt b/2023/data/day01.example1.txt new file mode 100644 index 0000000..7bbc69a --- /dev/null +++ b/2023/data/day01.example1.txt @@ -0,0 +1,4 @@ +1abc2 +pqr3stu8vwx +a1b2c3d4e5f +treb7uchet diff --git a/2023/data/day01.example2.txt b/2023/data/day01.example2.txt new file mode 100644 index 0000000..41aa89c --- /dev/null +++ b/2023/data/day01.example2.txt @@ -0,0 +1,7 @@ +two1nine +eightwothree +abcone2threexyz +xtwone3four +4nineeightseven2 +zoneight234 +7pqrstsixteen diff --git a/2023/data/day01.example3.txt b/2023/data/day01.example3.txt new file mode 100644 index 0000000..bc71f5e --- /dev/null +++ b/2023/data/day01.example3.txt @@ -0,0 +1,15 @@ +two1nine +eightwothree +abcone2threexyz +xtwone3four +4nineeightseven2 +zoneight234 +7pqrstsixteen +eighthree +sevenine +oneight +xtwone3four +three7one7 +eightwothree +oooneeone +eight7eight diff --git a/2023/data/day01.txt b/2023/data/day01.txt new file mode 100644 index 0000000..2416bce --- /dev/null +++ b/2023/data/day01.txt @@ -0,0 +1,1000 @@ +1six7396484 +1ninehgqtjprgnpkchxdkctzk +sevenmpsmstdfivebtnjljnlnpjrkhhsninefour9 +pppmfmnfourtworxrqrfhbgx8vvxgrjzhvqmztltwo +9eightctkdnnllnine +1eight3shhj8hrglbhxsixvhntf +4rlqzthlhkxvzhcm6 +bklcbpdlfctwofivesqvpxjjzlvn35zhlljrfqf +36qv +76six66nine +rvzrcjzjfour3seven16six +2eightjlm +eightxfcmkqjqxzxjvrfive3 +gxonefivejnvqbgnrjxv87gnlqqfdm +sixphvtnrgdvthreeseven21seven4 +sixttxkjggfourtwo13khgfcbtsq9nbbztfs +m8t +9fourfsrdbvptwos53 +vfqjtpmtp69five +tb17 +bctthnksix4onegmgpjbbxqqrmk5hnfvzcnsgh +2sixthreeonenine5ndxdjgkb +sixtfk2qjpq +twohccqqrfour1zjlqq +3nine6 +2zrstwopsmjmzdff +89three +dnrnmhkxp45onepttcbtwosevenone1 +tztph43five4 +nine4threerrllzdnsprvninezkf +brsnjcr8nineseven3four9 +7sixsevennine5t1five8 +twobhxqznqcft7nhfgcxqfourthree8 +7sixbdbvdnckqslvxh8 +5cnsvq82fiveeightttmnvcm +kptwone34seven5 +fourzx1 +twodcpmrxmrgkeightsix228rmcqf +two9dcfjcjz2seveneight7 +7twoqthpjdxc8xhfznninethreesix +vjbxtseven82vxbzjdsththreeeightg +524one +dxjqvhgtfpmtxjmlt7eight5eight +3mczqpssixsixx7ninenine +8667 +3eight9sgbtdrrhr6lfxbmfthree +two1one8sixdzxqqzlnhfpkdjxseventhree +kmflhtjsnq1six94 +lnrphbmqseveneightk2nine +s5 +hckfhhqbsg3srnzdvm2nine +three58six7sixl +1sixfour717 +4fivenblhmbxfjtwofive +jhmxb1crbttv47 +zcfive7onecgbfqtsgpxzfbtbrnine +nine73mrvdntwozbvninethreemsbcbjcp +qclgtqkmnh8four +twoqmzhp6v91fiveprs +bjnctmcctpzdq27six93five +djmdzpbfzsix1eightone5plbfrone +btcfdlmvrnhqgvmtmn4foureightt3 +7djtfour78 +onetjmpgdjqlnz5two +one5four +5eight27nmlfiverlzjxpts +365mvfhqfhflhtzktwo +two8gqzcgjxtcgxvnlvfx6lvvkbq36 +4srgn95vnqtwo9kfcchklpfvzzkcq +pcgjfvqlgp1663sixeight +pxknxlhdjs7rsjkbpzhtvzd +6one36eightfcqzktwotwombxr +3fmmdlktwoeight +foureightone5cgvdv +one9fourlsdfmbsvnxhhl +twosixkpcrtnhhbb3eight9six +3ninemrntwozvrs5tpbnz +sixsix3fourgrcjqsk51t +71six74threebrdkpfbmjnvpbbm +5sixbptk6ngj +scgttmjzqp6 +335eight +one287976 +5zgzsgeightfourkkcjl +47one1one +7one6fivesixfive +6ktjhbvrtsthreesixfxmtgrvtcntljrbxrxrdpcjcftwoseven +gltwone32vmxmzsqqfhbppvslb2 +tfphzkcxh3twofour9oneightg +gdsrbtslnbsixxdfrdz45 +3sevensevenfoureight4jnine +six5eightthreeseventwolf7 +spnv4six +nrlrqp7qgch5cmbhgrvbtppkmt8 +61four261bxmxxrz +onetwo6nbvgttmkx +5twofour281qhsc8 +seven8one +onexsfivetwo93 +ckrllvdxkgmjkqfpthreefrqjshlplgeightjvxhb3fourkds +nnzbmh3 +ps55seventhreetwo +eightsix67three +2threehcdfdxlkcsixlsgkkqgt +3rjxsxfdqeight81hpr8gppmxrj +9skrxzdvkzzthree4rsfrgpqlonefour +27three8 +pxpslqbbqmzcklvbd4 +eightseventwo6 +nine9dbbcqfhfkrvjb9 +72seven +2twopztmbkbttdglrtv8two +seven87fourtbdxjzktd4sevennine +5qpcvmkr5ninefour +twotwoeightqnjjcdqq45 +2bkccvkmeighttgqjjthreefour +56oneninethreevv4chvlfljbrthree +9sixseven9zspvdsqxzf +4four8ndqjtgllktwo4 +jchmqgp85 +dznstvthreeeightjzcxzsqbtsixqr8 +85ntwonexlm +qtgfhskvonexrg13four879 +86onetwonejf +ztwonexqpckxcz4jpqgthreebjmzxfnvz38nine +one1onekptcbbh5four +dnqcckvxngpndvmm7eight5seven8three +4nine8dgsqjhvl +142rgdnx +mprgxckmzbzvkdsgdjzfive5fivenrsxvhvs +five41fiveqxm12 +sixdhgs6dtnplsix +seven5djeightlrnghlkvjkclmsmlgn92 +ggtdbkngcp8 +one58foursevenbqbbkzbf +nine6fourrmpbsixthreeeight52 +twofjbhnfthreefivesix31 +fiveeightsevenfive1fourfive +prhfhbpzrzghj94six6fivethree +3mffjmjmtfczjhjqnine +sktx9threesevenlxmfkkmseven45 +13jlmhmcnvjzqsnthreeqdslgdlqzlmxgbmvzlsix3 +four7sixktndfcxzvmxx7ninefour +three2nine +7fivezvlklbd +fourfivesrczxj8one +63five4vhklbtqmninemhsfsx5five +3five2six1 +5qsfmsbtxcrvmvhn3sixthree +nine5xvhzlfjpbcc4xdkkps5 +p2 +4tczsttvpsql9seven +x36six83bkjhrsghkvvgtthqtt +8sixfive6 +three9fivekmr +sixone1sixthree1 +4reightfivetvjbsnql8 +five3gtmgqjnkrq5 +jtwodpjqxgthreekrxggbhgbtone1 +fivefive4 +gxlchjn67 +qrlv27skhkmmninesevenqxppzdgeight +72five4 +ptjtgsghgrbffgnl27one36 +sjkdqnqkpqcpp9 +xnggjgg1 +onemlzp1 +gcr74bjtddqvqktl +seven5bgvsknbsdmjqptkfdfour +twotwo9429b +seven5threec +four6mchmrqv +kjj1zbfsnmmcgzn +2twozmzfcxprsxtnrxqtkpknhmbckdqd25 +fivefour33kzcxdhn84pphrnf2 +mvcsbvvg4eight84one +eight8sixfm4sixeight +bvrl21 +klnhdcppjninefivenhdk7 +four5three19jkjc5threeone +jvc9cptctvcrlqsm6rkbvvknbkdpffj7 +threesevengblssstwodzkbv1six +rdzmsdnbvtwogthshznninerthree34 +onejrpznrfft83prbgzczt +fiveonelgjvvhbbdlx42 +fvpjgrtwo7gbqtsslbnptbt +7one1 +h4ninevlhftscfkl +rzrgg7qjfrrxgzctq +fivefmpmdb1 +eightthreepmbzqcqthree7 +sixldscsmfive3 +ninefgztvvqchq8eight +pjtfive8zd12twonine +rdgmgqv2ttz +cgtxczthree5 +5veighttwofour1 +sixjninethreervzgnqqqfive6fqzntfsix +mfzhfivefhsksgjcst5 +fzeight4 +6sixeight3 +nineqnjvxf1one4 +hcxxcxd2seventwosevenxcjmjvmhnv +4four7 +35ninezvfqsixqt2kc +dzloneight3 +two7jbnkvxpnhq +tmljsvlcstwo37six5eighteightgtv +five2sevenqbponejsixvvxkc +9pmlrcsstwo295 +ntbjfpzzslgpnn5fivethreefive5 +72tlfdnjdltstwo8 +qvzclcpqzgfkkcb93 +three6three1xdkn +dgkbxqzjthree7 +threesbjninevdvlhhq572vszh +six2three5 +sixnine9xpmqlbpd +jvrdcf8 +6kpcztn1 +1jbgcthree3eight28lmfhzn +threetwoeightseven6 +dnmtn8knzjjpmzfxvlrq +3nine5 +19two +fbllsixseven1onegqpzqeight7drgf +szrkhpxm3hbcdgrrtg17cr2five +one2onehhplgxctmv1237 +81two4zgltbz +one5c +five4sevenfourtwonvnldmvpeightfive +greightfive82seven +6four9eight747three +lrzgd28lzfljk68sixhnnljtkzkp2 +vone6sixvzzzkmm24zzjskvzv +6seven2 +cm16one +6mqxpzlxhone +2teightseventhreefgksfourfoursix +3vtqlzddlrbpxmnjqntwo7fiveseven4four +32ftslmt1ninejtdxnine1 +one3sixfour4gxkchbrjzf +6eight9threetwo6onexcqlqfzfive +onefivexnjnfc1nineflckgjzsix +59ninefoursixfour +7tqjdninelnfthreekcdxfqzcl9kmvjfvbrm +xjbseventhree86eightlpfseven +cbzvgxfkgneightfive98 +srsdrninevpzgrhrqtjfour7htbhbjttb4 +hdmxvkcjdjninebzvmsgsseventhreemhggmhgg11 +four32ninesmjgblfcfmvlffjtwo +kdx7pd3pcvrsjkczqeighttwo6 +one2pghjsggtlbxslmthreeqgcskttvrfseven8 +gcglgbqbxzjrpxjzvseven88 +eight1fourpglqv +1twoddkk2fourseven4 +ninejrqsksqhtl9ptd5 +ppkeightwo5ggthreet +7onefhccblsv +eighteightmp6fqrfnpqjvx +bstdjfjmxjjpz12d +mdjmpqvhjzk616threefourplr +7seveneightsix +nhsrvtwo37ninesix +1one6gxkknfmc2oneightq +8dfflfour36 +37d7fmzkzztwo1 +6lmg2qmcsix7r +seven889xt93 +phbhqftdvvkssxktgnc6xdcdxlxzfneight5 +2s593xvlrdmjcz93 +rsmgvm4 +eightgmgqb1 +35qfqdkdtgrvhdqdeightmqjlvlpfvzjrj +748 +kbmpxqnk61ncthhtrkpznbxzfbpninehmhlbkdjtjxtx +foursix4mpfoureight1 +6fzffnqzqb8tsccfour8 +gzsxrjkcm44fournqzpseven +1243 +2threeonefourtwofour +ninefhnr649ngld +fiveseven8 +ttwo5three5ninefxsqxvkhzxzrsr3 +kljvvxlvpctfz3seven +jkh8 +9sixxvfnnznttseveneight5 +92eight56onezpvrj +chzsx4 +53fivetspsfive1fivenlmtvbl +plvcvn3brcrcqr94six5 +cxqnlbplone97dgpjkkvfsksix64 +eightlcsjrkxeight4qbgjffmnxlsvzcdsvbl +4ghbljhttp36 +ninerpztrhv12 +threeeightthreeoneeightsqdknqlf2tg +tbfnine8fourfivekllthreebsqjgqpvsm +6oneone +eightsix2seven +t8fourtl +6six76eight +ldfkqkgfiveninerqsrscftpv57oneightr +vcnfvftwo43 +kggflclnzjjvxkc5 +19five1twoone8four +77sixkzrpkxpzmgd +12fivemgxgbpz2seven +582gsvccszvk +fxtsdfrtbsgplxlqffivejtnsk9 +kjhkjvz2dcxs2four +3twoseven886kr9 +seven49 +611mllnqfqlnvone4 +18sixnpdcjcjpm +hvs9fivethree8gfdjffmfour +5two1threerkqxvsevenhmh +qpkdnine9fivehfiveseven +jkspcmqgv5 +2vrbhsxmp74six2qcmnpsfffnthree +zqmdtrgktlvbjlsxjf7677jqt6 +gxmtsevenddtpqpxhljoneninedjvhqhftcpb9 +qqxxbhtfmpvdq4seven2jscgkqkj6 +61365q +gvztklvxtwo8kmdlbzxglf +ninepxtd1pbcxbfhkvtsix +6cssbfstfbspvx +rdkhlqrhmj7fourbpbrqxmbxxsnthree8 +12th3rlnqgpc +4szrvgbcbg6dpsjzcdvgone +lfour4 +5threefour63qcvhpdxb7rmsdkl +4one452sevenfour53 +nine5gfourfour5bttptfq9khknptfrbc +348fsvvfk +one6ttzlkfxc +sevenmksqtwocthdjtkhr95nine +7m3jlqrqb2six6 +lrqqznf6nineone46 +slpgjbslvtfgxsmbgzksevenfive4six +7jvnnqc2844qfzfour +64four353cpm +three9fivejlkxkzn +vcjbnpqj7plgbdblvgp +twofgqtzvspzjsxjkvrbs8fourgtfznpjxk2 +seven44fppgfournqzmgfzfone6 +h2jxdpkjktwo +kdkoneightjstgn9 +7bbfsgl6sixdchgpnine3 +nqvqmzxr86 +3dpntnsdk +6ninefqblshpxvteightnbqzfszjndvzksfpsxone +59vztmq2three1 +nine9sixhnfczn +pmkm3ctrbjrdninetwoneqzj +7znmpvqonecmmdcschn +5five5ninespthree +4xhmkgkmtgrtmrzrkjmgjsixninefxxxlvdknsix +7rnlfspthxjvlcs7nqtggmninefive8 +5fourfour76gpseven +two9five45four3 +5zhvmrbccf9fnsfvb3 +3hcrhfkkthree +4xlgzlhjceightqxvsix83skhkkvzbtflbvvt +six58ppcxmph23lbxhvqmnnxheightwoklg +ninerbxxxtl4 +4dvdjjfmhlfnzjrd3ninelrlhdpngvfdvdkjkbrone7 +vpqtgkkdgqklmbc9three +foureight21 +71 +7two3kcvvfv +58vtsnlfkbt8czjb +6threebmncseven8nx8 +eightmgsvctqb6xslnsgl +32sevensixmsppjkzrgqtmzvpsrljqssk +85l94 +nzjqttsevenmrfzzv7 +threetwosctspxzjgn5fivefour +2six8one87ppfhpqks +eightzfjfccdcvfiveone84jf +eight81eightsix5 +foursrkldsthree5fzzmseven +7five3threet48 +4twonelc +8eight6t6 +qfheightwo43three785 +two8cnsjshfpff4threeffqk +4dxfmd46 +7grtxmvhcl849two +five4fivefive7 +14ffour +92nzsk +13xmgqq9eightnptsixpvpntzcjn +29eightkpqnfour1jnine +4bcftnzdmcgvrczhzsn8dlqkzngjc +1pqmkbthtwo7 +kzcsixxcsqmczrkjvhv3ppt44 +eightfbvplm677csfzfncptflmgtrntqcpptj +fiveeightthreethreelvp1 +dlvdhtvqvfctfl8four6vvrkgqddd6 +msgtg12mgqcfvgxlgdeightthree +qzjkz5196fivevxkpvngfxrfourthree +seven4nineeightjsevenngfourfzdx +9fourjbone7kmsc +eight43nbklgg +ss4c +4eightsixglkqpjtwojhxmh +sevenfzrqv9mvkxgpghtc3one +fk7fsgndcrthree +7194czfive65 +9nineone +six5djzqbcdncfour7 +zceight3two4vfbmtfbh84bhrpbndm +7trqzbdjqeight4sevengzzsixjfkf +two3twovtzghbdcmc2 +ninehrrdr1 +3nvdvvjhxptsix7nlbdlz2 +zdbsxpvbkfivegsndfourjftnlb43four +smgqrnbzd3plmsngdvz +lplz67 +2pvqcpl2 +mvhqninetwo2 +1czljdtxnz +threefqqs696fivexssmqvpp +xtggzdrg4jllfkxtvv4xqlvtgrllseven +ncdxmjcfllr3eight7 +3ftjjnzthreefmjmshdd +7jxs753four4 +8eight54six2lxfnmtndgk +54sevenjnlnlc4zvmdd71 +threebxcjdpprthree3qnsfqgbcsix9cbhlnvjdc +ptvdrm5vzc +8twolsxsgmzfqfivefourqlcpzggfm +skjzfblgsl4five +onesix9eight6 +cnmjmkzmml732 +l5one +fivesixclsxflmtml1nine3bj9 +5zqbxz56lnbrntwo366 +89seven +eightqpvztnrxxc4 +svbxfssmfsnflkbzmqfsixdzfdlgeight31threeseven +tkkb2twofourvxcs4kgsvgkztjmseven +25qcjkptgbz +twokjcthrmnsrtrkhxptwo2ncrfive +seven92three1hnlbhzrghxone +onemvghbhpzxdhsssbms3sixnine99 +qgtwone3sevenmkfourxqvvfive +lq141 +gpvtdflfive852four +gdtwonekpfhtmkfseven6rqonesixtgdxttnjzc +seven2five6seven +skdxqonefourgrp6 +djlninetwo7five23 +hpxqlmqeight2 +8sixeight29ninehfnllkvgeightwomp +326kvfsnb +eightfivetwosixjhjkhjtdpx4 +mtdj4threemtqldccqhffive7pgnrcqpfive +seven74grtdbl29four +twonseven6 +sevengmtlhxgqcbrjlhgzs3sevenkrfl +28zmfvgql +geightwolnnmmhczzj1p +hkbknzsbgpfourdfrfdxpqlz2seveneightseven3 +34bbrjvdqszqgbkndxsz5four88 +dxfhkfeight8qsix4five +xsnfslsc5one4dnrsxlrklt23zhgknhjrd +dgkrffzctzpk9fourdvmgnbbnfbt3 +jbfkcm5sevensixpkfnqqgffdvkgmjsbpkpqvsixjrvm +mckpzdvnlrsltktbgeightjk6xvsfmhszr +1one46three +77eighthgzqqg1 +threechgthtshpqnxsixmzqqxbzdtwoeight1five +ltnkv3186eight5five +fourncknkmdvfpgtdkqlxone5nine8 +gvnvsxrfdcfivekfcn9threebsxdsnbhtwo5 +89nnprfkrhrmfdzqssdjspvzzpshnzxsrzctwo +3sevenxhnlcgkjnccgbrnfhzc +678fivedvtdchqsevenqrmvjqlq5sfxnqj +xbb3 +3d +81sevensix +59sixg +3foursevenone +four6nine48 +6lkhqsixnnhsjqeightc96 +sixfiveeightthree9nnvsgmgllbqvgjpqhfqtznm +sqgxfourninenqpgx15fiverpk2 +zlr8fthree +jnztj59 +5eight13fourjvxfndzptfnjpqzlb +459zpnrzbxdsplpspnh9zbqvdnxgdfour2oneightmfd +28twoddhpqzf7 +6nine2168mcgnmc +4fiveqvmd8157 +1sevennine8793kxkx2 +sixrbr6ninemdmsmjrchbvhvpmmsfphtslll3 +one2qcrqhbqnine +rmrbtgfkd2cbzpggbp6 +797fbxjbb +fiveonevsv2four28 +six9sevensix +7nxztt +three3vcqrjgjndsbxpvclvg2vsv3 +22rgm3 +jxrgtsdzppone5twoj1sixmrdxrsbmf +44fivefzkdrvrdp3hbmp +17bgrjbxone5vvnztxhpztnmvtworzmc +keightwoonethreefourtx4six +2threexlsn +8ktqbzfninexpgkppg8 +295hcbbnineone7qdgcvjzcs +hjshndvhgz3bjh4sixeighthvxmdtkkbgqbsdxg +8jdnprbkmxttwo +fivetxhgnjfkhlxgts2pqrvjbscrq8vqtbmkrpxlkhvkff +njgkqbnkmdqjqldmpdfc1mjqvm2eightxzlbcz +2ljrbbmseven +xmxqpchds889fourpnzfdljvfltwo +six4jvfnfsfjseven37 +ddbgmgseven3ninefourmtlvkxbrnvnjdfspjffour +5mkjjnine6one +7fournqg9xvpfh +sevenfourone659gqddprfrqg4three +twothreem382 +onetwoeight8kqbtmbdhc +817onefour +8gmxjzj +bckmc3four3three +746cfhl4nffcksqlonefive1 +five338 +five4bzkg +thltwonefour9nxznrcfbx52onem +four5bzbhzvmqqbhkone2three +seven4five85sixcf +4drchjthree4 +sevenzsg9vmdjcgsvvxz32fiveseven +hjnkgzchqfjfnfv3dxbxn4 +76sxzjqfhpc44 +72threesevenknkbdhqvkpcxvhlldhzdkone +six4srtzrmgksrvkjktchl +sixvnhlzfivelppsevengbndbprhn4 +five1sevenstpfjpbg4 +3ztrhnxkpmh +czpbffqlkkjdfmkspxvfrqrgn4rfmzvfive +fourthreethree1nine5ninekgqxlhvtlr +4tcjctphneightptlqlvxmfkb5 +cvbv798pzrzmfivesixqhxdntdtcq +6jkqptcvrjdnqtkblfour4ninedv9two +four51eight +3two9eightlbvdcrxkfive +3six5three +3threesix65seven +3three8two +45b9sevennqnmkmps +7threefourseven7cmtmnfive +6six8seven4four66 +sevenfour91sc6sixghqhfmgcfour +ninelmcxtwo4hlstzlf6 +six45fiveone +seven9sevenqx3vtk +skpsxhnqsix3one +vzveightwo5five2sevensevensix +cd9nine23ngrcmcxtd3ltpcn9 +vcnfshkpone72ldgtqonehjq +cgqvcjnbtwohkmcfsvfr82nine9 +8one75fouronedklf +3fivenvnhlrthree +369sevennine9twofour2 +ninevpbmftmll57fivedjqpxnpcjfour79 +71rcpfnl5 +psixzxslfrmxdkcxvthree61npplpmrmnkjnvloneightfl +42six3fournxkjcdslp5ninetwo +8frbrhghpggq2zxjhrqdssixfivefivejrbd +foureight1pgsbkhkjnz78seven66 +sevenfive4ngxfivezs4fcvx +kxjjbcxx6qh5jpzkgml +7gmgqrxt9fourk78hmmjt +nineseventthxmrxdsn91three +seven1mbqn8fivezpnrpjbpsx22 +2hfvqkeightrnscdeightglb +onefive7 +heightthree4qdnvhxbzjpd7vvseven +ninengrzsztmtnkjmjmzqqqpcbx7fourtwoeight6 +sixfbrj7two83 +eight1vnqrf9zdnineninecbfcj4 +chsldbpnmxlgbjqbpkh34six5prb +zrjjtlnc66271dssfour +3zsdjzpqtwonec +eightclmbz3gphlxeightwov +5cgvfive +fivenine54five9 +64ninenine1371 +rvxxeight5rmd8three +3fivenfhskrlzcrcdxjvsmmxfiveone +sixpmpx7jbdone7qldr2hz +3two8nineone9 +6sqdqv +pflddeightonensqrchsrsixseven2 +threesix2sixsix2 +5594zhlqbkfmmplvcclxjcgngmfrbsrxbfn +fourblpmgmtxltjdmrlmdfourf7bdjllqsbh +4twooneightf +fourjvddcqsxbcrjthvcjjshbngkrfive4 +threethreefbdvxfksrsfnrk42hptbr +692nrjhjfpgg4foursevenlgm +fmfbd6pcqff93 +gcdgfourbtttvlone21three +onejczqmpbrjqmljmchkmh77mnzsxp +cnpfc87three +2one4 +hzdpmxflk1581three29 +97tnzqknz15bxttzrsix +5eightfive +894six675 +fourcqmgpdsjdjcvmgtsevenndfkgrnqbp6fourfive1 +fkhfz1kthreethreejndpdrjddnvztgt +tpn3threemxtdkfphvctwohklcbzdn74nhhfjr +5fourfour +six8twoeight163mrkvvc +ninersix8 +1twofivesixkbpljt +67nine11tdnplxklxkdbxffn6 +ninesix9gfive7jvvmcrnine +2bvsqxbd7drclkbxrtnine +gtrmtlzzsixjxqhzxcdqppmf45two +three43threefdmsjxxdvkthree58tblfvxx +one1365sevenjzbgtrjtlc +1twosevensixnine4four2 +1fourfzone7 +cpzjzkjzkksfzv96zxfzhfzsvslbmqdshdthree +191kbfcfhtmgbrnfv26chh +vfcqrcrseven3 +nine51 +twosbtkk21 +8twopvmrkntqlzcth9twozxrfvgmfjtqtt +sn286four1tv +xqzgxhlzjh9vnjvjcj +three24lkqphqnxmt996mhcqhpzksn2 +4vpngckh +seven3v3r1eight +one9kxg +twofour4fourjcqjznsv +mnine5foureight +fourchqtjtqonesevenmb319 +17sixqxxgnine4 +1srrc7 +8mzhtnhmshfourthree1vonet +qzppxshxfninesixk13 +9sgbnnspt4seven2248 +seventwo6 +687541rsk +ninenineeightmgpn71five7five +eight9twonineseven4eight +ninesixnszfprlcftgcpcxdfhxs5eight +xxthree7n +tworxtcqscbc6243zhcd +two636nzhpbslxhrlkxb +six7nine +78five6one +98twokpxjvkjbxxfourlfnnttgqzh +7sevendzghjfczcmc26tkshcfhrhhzxone +fivethreethreenhfrtdtg7ninetv2fggncj +prsptrgmtbkxvrpsix39mqqbnqf4 +bctcqqqjtp2jshldz +ninetffzllkztqvtm9nsbfkbbfteightsixnine +jvvcsrd1657nine +8cbltrdfzdeight8lv3q +lnine3ninenine8pczjsj +88ngpzzzvzrhqxvzcdrrln3nine +qtrbmdqgnggmjqxbx8nine1sixfive +477 +tckszrqktzrbc3one5 +seven5seven8mfzfzvrm2sixone +zl29fourone +lzctr93bmrgsixppljzgzrvh8 +fivegqcx4fourninefour +6tmjrtfive6nine7xoneightgxv +9f +r4fstldg +twoseven7vjjfgxvq +dkpxkqnq9 +kninefournineseven5twolldkfrcjk +2kfbdbfqvkqvtjleightsix +nine7gn3rphbnllpq +five12 +ngpzsjttwoninefpgt549 +2mdqsrrxnhn +twotmgtbxqhx2dzzjlxlc3gdrt4 +7sixldnkf2four2bxjv +3nxdsdnschqpjgsbghtl65mmbsxklqr9eighttwo +doneight542nsglfmbrpzcgx2xsixnine +7ndhvcpcbncseven1 +dxxzmpdbq33five +xhrfpsgdh3fourgpt1sslfnt5 +dlddczbzqchdfhlnnrqcdn5 +5eightthreegbqgpgsevenfourxjvzthree +4rtplhnine +twotwoonenine3 +six2eightsp6 +mtsixtwofour8vdfr7bndr +grrtbdjtrcfvnine7 +jtzhfqsvxthree6dqcjgmj +83seventhmvgvdrx7 +957six7crlxqfdbxnjhpxkstktspl +twoeightfivekmfdrttbbtwo4kzcxksbs1xsnm +8eighteightfoursixsix +eight1nine +3xdtdbq +fivepthkrnlls63pl1qhf +674fszvbrtskfmzs +jdghpqtwosix52hggmrlkhqsevenbnfdckqgr +9two89bvckm7sevenzkdfclktgc5 +twosixnvqfgcht9656three +vsktxrbjgt4zxffxftwoeight21four +twofiveznfzntzteight838cppl +18three57fourseven +rnxbcmszgbeight5 +twozpmknt3threecjzbcvtwo97dqzkmh +2fournine +tvngfkzgj6sixgbspfpbgzmrhlb7 +162fivehtvcpsgmxz +695dcktwo +fiveseven5jzlcvxctcf +3klrsxtgbjttwo +seven17hkhpbdtonevhkgvhrzxbsix +3twos +cssixsix956xggjfzs +threetsrrchdt62cmzqzvzh +onefour3 +sixzxbbplldcz5dgtrm196three +2onejstvfszgtwodclflrrdvr +9zgkcffscqfhxvlm7sbtlckone +xvnjnvctnpskzzxfl511jfkhtkxmjcdjxdxvrnzs +eight73mfsevenjjneight +ninehfqxjhsmr6foureightqptrfcvst57trlvnkfh +ct562pddspdjseven +hxcslbmf9453 +seven9f2bcftjdb4hfxl +eight397qjkqvthree5dxqnrk +nnhdtvpvk1two +lp432sevenone56 +mh3sixxdnpthreesix +nine9oneightgl +ktdfxvzsvhlr85tthree4 +onenine5three +lggrspnkktfoureightsix9hvtgcrltthnkjk +1g +frbphfseven1rhrhxfdzctdqkctjpjknqr8 +fourfourone2seven +fivefivegknxfmggnplhfhbpjvlnpxlzoneone4 +gzqthree6ldltpkv5krjnslbxsmrvqqvgkpg +ninevrone66 +tjsxlzd995sevendoneoneeightwod +threenstfpninetwo2 +2827hsdrnndt +zeightwotjnftwoonebzsnkghseven2 +7twoneightfourseven +6kdqzbngsg6eight +hxvvvrtqkvbmprqjvvsevenone9 +fourfour2ninetrhcqs +sixvzbd53 +mkqpshhbxnsfbfiveeighttwonvxkm4 +two6pnnzxhm8kpdkhntlpqzfqlfnp +fourhgzrsplfcmjflrf174 +fivefkxrdrfcr4 +pqgmrvltcgphhcz55 +ccrqsztx6cpxsdvjsnsevennhtxbkm +27twopnschsix79 +9kvonekrjkcxlrhvgxh +7rdmxdvb34fivevn69mnhhnmtbmn +vdvttfcfdqgzpninetxbtrjkfbmninetwo9z +four2three +67vjzfsevenfivefour6rnqlv +jhqkmhpnv7 +sblrrklj9twofivevqmhgjrvqjzvxqqrxqnch +5mqgbgjbztvhsixpsmmtqr +kqkpd5eightrhzmsnbsn2bpflnhtflp +dtwonerpnzkztksvrnrjktpdnstwo9hzqlsd +xqlsxtfshhgqtzzsfsdnknkfv4fiveone +fourfive64 +tprjnvfeight8jf +ltvghtsvrttnhcvkldvttrpjfxrsfkscnine8ltrbclsjfour +8eight2jqrscqbkcxcone9 +57mrgvrsrjkttwo26hrhlcckgcjqppczf +84scltxqgqlpxxxchmsevenlhjgreightwozs +xhdhbqzzctwoxpqrvtwovtrmtwombvgjmtb1 +ninelr5 +heightwo2 +onevbjvninelsxlbgjqmtwojc6ksx2 +dqsblgrckb6dgzhkkeightoneeight5 +2lmrlthreefive6 +9rgdspmxqj4ddzbn +ninehgbsixpmgjq7pddxzbvh +pnbvrppdh8 +xfpnbsjjnfl7lnm +cldxp9qs +cmnoneightgkx9eight +1fbdf5two +six3eight4 +8three2h2 +6eightzjzhdnffnrrkbnvjlpn9seven +7dxt +dgqhqxnhgmdn9one +4fourfourbmv9gplqbjgqjdsixsdfsmrdh +8ninevqzzkgctwo4three +kkvkfivefive197qeight +djblkcrp5btpnbbvbggclpmbfbp5hz +nine59 +5onex +98f71ngphthree +gs72xdvbn639 +nxdqfour11six8 +9dzjtskgmztkgzqsfvkljfeight +bddtwosixtwo4two1 +5ninehqmqcfiveqlkszqpsnf +qjnfour84hlzgk9 +8one13twofivelgdlzxtwo4 +sixnrsnxdpqseven3onefour +tnine15nine9 +1sixsevenzxzssq3five +vgmplmbqp6 +474dkjqxponehrtzhcdkpjsixrfrhgsmpmcdj +one7vpjbptdczcjone9threekrnrvhsjseven +vtrdvvhr4one8lmp8five +seven7tjxbfourpnk7eight +two8fivefour3dcpfkvqqk3 +onefivecm7seven7nxtdbxgv +2tbrjrxkcdxeight7lbqprjkv +nine9clgppmjqbczxgpm4qjcktms +ffqdvccvslnine4mpznnjkxp219seven +tworcpjshxfnf23vdvp7rzjfhlgtlf5 +xc22fivecpxjlskm +8jbrzjroneninethreefivevhpp +lvvcxptngphhgfbvj25eight6sevenfive +52fpkhmsnfivesevenfivefiveksxlnznzsngs +threeonefourseventhree92hrmtkprxzrrmrhc +kjqph5mkhglseven1four +rqninehxvvslkzl62foursixxlbjnfhgnmzls +hj2eightpninefour3 +8nine1 +9eight12hlsbhtsshzrthreevzkpcnhkbg +twosevensevensevensixbtvdcdbhkqjlnrvn8eight +pjpzmzqgbthree3 +7xpdxjpq71seven1one +7chszctznine1 +gprhvmvp4 +twoone8ninetxmhfhzveighteightthree +eightgccstrqxjh7 +qcnbcfdhnine3qfbsxbsnhf +mmsfvcxb6fivesh +7mzzppcfblnrxkk +fourfournine6five77 +zrpkzfivegkfsxcsptjvsgvdsjfgvrn83one +fourninetwo5nzp9 +vpteightwo2eight7vxvlblvnnskqzdtp +sevenbfdjs36zr9791 +ceightwo8nfzkthree +twocnjmjxznine9three2 +seven4qxznjddnvfivesttbbgr5six +46fourvlgnzfzt +psxcxreightkqggjj823sevenlhvh1 +ninethreeeight9 +2glvrxgflhjbsfivefeightljtdg +fivenine4 +52hgone +33fhspjthreesspqfnone +srkzqmnqgr1 +gtxxbfndlssbntrnspdptjkbdxgpxgd9nlddsndjzmq +zjxvbmjbqjkdgdghplk536seven +sjdgghzkrr4rvvfx2 +4eighthxxdksdtr +5two9xlrbndb8 +7twoonedhdtkqj8pgcsvjmzm +76threenine2vjrcmbf2six +sixtnrf3nine +nine3onebptlmfxzhppmsprg88 +sdvmxlccfjqrdzjtxgsfour5bt +sixsix53f33 +eightonethreezrrlslcvsm92eight +9xfs162pmvbzzkjjksvqpcqlcdtjdrt +four93sevennine3 +sjmoneight5349 +scdjfs2ninesevensixnine +four38rtkvp78dbggkmbfhzeight +seven56trjmqvk5three2 +qlnbmvpmdspthree5bmcz +sixxsdb6lkbrhthreesntwo +five24 +eight6sgbmspbj5qrzconempkp +7nnzmtn1sixpplhjblfmknn +67seven629 +8fourfouroneightr +73hq186onecmlp +sqxcqvlsmqj12 +vsdztxsm837twohszjzcnghvng +6lmkngcrthreefourfivefourcfbkzlbkxlmcdzvg +onesdmsixpqdgxhhpkqxts2 +threexcfjj6 +tvgsxk6 +jnhtlnbr1oneoneonefpkkvpmj +jdftkkjmqbtxcfpstfxseven5three +12twocjlqvcqthhndseventhreefive +fivesix7four3 +7rshgk6ninevlkrt6pjfvrspvljfkf +bxjnbmgvnpsxjxqz7vkjztwo79seven +threetwo46two9bxrjsbzm +5twozhqnbx514eight19 +oneseven2nine7nine1eight4 +five9threekpstk +2five3cxlrbtfivethree +ljrhhfhgj3fiveeight571 +65threejpr2two25 +3five1threekznxssgt84 +698458 +194f +hxxpzlqtkninethree89fivejdthree5 +frhzzhggn2qnxqklrtrvvdhvnhfkml +4lch748threeeight3 +six919mkvqrbsnreight3one +three7five7seven +threetwo3 +67five +sixft9 +nineqrh4 +mvtwone57hone3xntlkbktdcfxjhm2fsckqbcbqx +nhzhqmvvkgfourbnzrfnm5sixfivedmfqldqqzptwo +7xvmvpddlv43hkvgprfour28 +brlblxt2 +qqxtd9seven +sevenoneeightsixrxvhnx9g +5tjpxkgtqxn3ltnht6 +sgnfscdnd52twozg +fivetwo5three5nine3fourtqdfnzgn +66mglqh5vsbqtthdbtxpztnskf1fv +xlleightwo72tctrvxfk4one +8fivedrsmv1mrcszrkjfscjztwo1 +4eight92twolpbdfivecbdnjzs +pgfftmjxqzrc7sjvssvbx1ldkjp +ldvjjqgjhd9four9eightpgddrrc62 +9fourfourkqgdf +five4eight9xmkzbqvtgthree7chfjlpc3 +12bllmj36 +mjqhmqnbhjtbxkrsrppeight2dctpspsix58 +twoqblpscffvrflclttck7 +21twosevenvpkzpmq +gvmtwonineseven6 +twog26sixnhgnqmlninetwo +fivefiven1mqxsevenvqbkfqsrtmghfxtpsrrd8 +five8oneeightsixtwocfcdgmrdsstwo +vlxxnmnineqxnsixtwogq5 +2eightwos +hs4qttkxpggjtxdbzfvcd8onervnfh +lmc9 +4nine1fxmkcvllvfivevqcvflgnqntwo +73cpgmckj +four7four92lfqkmgponeightbf +eight4fseven +two3sixfivebdmfkhbngrpj7nfrmj +745twovchzs3rgctnrqgt3chslcd +bgrhrgjbrtqshcg69sevensnbseven +six6sixzhf +9fourfourthree +9f93ngbbnxkpt1 +fourfivesvpddkvmbchdjggrtwo7 +7fourbvdtdrrxlsixkvsevenfstssflone9 +eight2ninetwo +nxb9five3 +one7xvtwokqnfxp +two777vrlcxfsmrcnine576 +xxhmbpvr7vvppfreightthreefivefive +pcs3sxdgvtwo3 +fivegpgsfjhcg1eight +nine8fzqgffnqrbdjsgxskcqxz75 +tsvtwonerjmgtbzng9 +6xssgdfxxssrfive +2seven42h967 +63zzmdfcjtxtnineqjncktkkttjfrr +7eightfjphdvgs4nine +6dxbttshgcvfngclmhvbzfeightnine +1eightkgqtwo8twotwopss +46two +34t65six +vfh4zteightkvbpps4rxhlnctjztjfvdvdxfk +9zpdnq +4klxpvncr5 +dsjmjbtvhv1fskzhvfrtc44 +7two5 +3lnksqznzh +five5four32two +llkbrncncr5nvsmbrzdnine6 +nine57 +7rdtplhbvddvlkonefqsttj +four6mssqzhgxt +gphnqxhlhzzftghk767 +mbcbpjcsnt4six +one9xmhvzklmzffive1kcsixmnsbm2 +1dgschj +nine8foursnczninednds +9sevensixrsrgmclkvthkgtxqtwovtlxfrdnllxvsghslh +seven443six8three31 diff --git a/2023/typescript/day01/d01p1.ts b/2023/typescript/day01/d01p1.ts new file mode 100644 index 0000000..ff2696b --- /dev/null +++ b/2023/typescript/day01/d01p1.ts @@ -0,0 +1,9 @@ +import { lines } from "../../../lib/typescript/helpers"; +import { pipe, mapR, sum } from "../../../lib/typescript/reducers"; +import { extractFirstAndLastDigit } from "../../../lib/typescript/parsers"; + +export const solve = pipe( + lines, + mapR(extractFirstAndLastDigit), + sum, +); diff --git a/2023/typescript/day01/d01p2.ts b/2023/typescript/day01/d01p2.ts new file mode 100644 index 0000000..b112299 --- /dev/null +++ b/2023/typescript/day01/d01p2.ts @@ -0,0 +1,9 @@ +import { lines } from "../../../lib/typescript/helpers"; +import { pipe, mapR, sum } from "../../../lib/typescript/reducers"; +import { extractRealFirstAndLastDigit } from "../../../lib/typescript/parsers"; + +export const solve = pipe( + lines, + mapR(extractRealFirstAndLastDigit), + sum, +); diff --git a/2023/typescript/day01/index.ts b/2023/typescript/day01/index.ts new file mode 100644 index 0000000..fa41326 --- /dev/null +++ b/2023/typescript/day01/index.ts @@ -0,0 +1,4 @@ +import { solve as part1 } from "./d01p1"; +import { solve as part2 } from "./d01p2"; + +export { part1, part2 }; diff --git a/2023/typescript/package-lock.json b/2023/typescript/package-lock.json new file mode 100644 index 0000000..35107f1 --- /dev/null +++ b/2023/typescript/package-lock.json @@ -0,0 +1,230 @@ +{ + "name": "typescript", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "typescript", + "version": "1.0.0", + "license": "ISC", + "devDependencies": { + "@types/node": "^20.10.1", + "ts-node": "^10.9.1", + "tsc": "^2.0.4", + "tslib": "^2.6.2", + "typescript": "^5.3.2" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", + "dev": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.1.tgz", + "integrity": "sha512-T2qwhjWwGH81vUEx4EXmBKsTJRXFXNZTL4v0gi01+zyBmCwzE6TyHszqX01m+QHTEq+EZNo13NeJIdEqf+Myrg==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/acorn": { + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz", + "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.0.tgz", + "integrity": "sha512-FS7hV565M5l1R08MXqo8odwMTB02C2UqzB17RVgu9EyuYFBqJZ3/ZY97sQD5FewVu1UyDFc1yztUDrAwT0EypA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "node_modules/ts-node": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", + "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/tsc": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/tsc/-/tsc-2.0.4.tgz", + "integrity": "sha512-fzoSieZI5KKJVBYGvwbVZs/J5za84f2lSTLPYf6AGiIf43tZ3GNrI1QzTLcjtyDDP4aLxd46RTZq1nQxe7+k5Q==", + "dev": true, + "bin": { + "tsc": "bin/tsc" + } + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, + "node_modules/typescript": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.2.tgz", + "integrity": "sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "engines": { + "node": ">=6" + } + } + } +} diff --git a/2023/typescript/package.json b/2023/typescript/package.json new file mode 100644 index 0000000..d80904f --- /dev/null +++ b/2023/typescript/package.json @@ -0,0 +1,19 @@ +{ + "name": "typescript", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "@types/node": "^20.10.1", + "ts-node": "^10.9.1", + "tsc": "^2.0.4", + "tslib": "^2.6.2", + "typescript": "^5.3.2" + } +} diff --git a/2023/typescript/runner.ts b/2023/typescript/runner.ts new file mode 100644 index 0000000..17b9bf8 --- /dev/null +++ b/2023/typescript/runner.ts @@ -0,0 +1,13 @@ +import { report } from "../../lib/typescript/logger"; +import { readFIleToString as getInput } from "../../lib/typescript/fileReader"; + +const MIN_ARGS = 3; + +(async () => { + if (process.argv.length < MIN_ARGS) console.log(`Usage: cmd [fName]\nOr: cmd [fName] -e`); + + const { part1, part2 } = await import(`../typescript/${process.argv[2]}`); + const input = getInput( `../data/${process.argv[2]}${/-e\d/gi.exec(process.argv[3]) ? `.example${process.argv[3][2]}` : ""}.txt`) + + report(part1(input), part2(input)); +})(); diff --git a/2023/typescript/tsconfig.json b/2023/typescript/tsconfig.json new file mode 100644 index 0000000..e075f97 --- /dev/null +++ b/2023/typescript/tsconfig.json @@ -0,0 +1,109 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + + /* Language and Environment */ + "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "jsx": "preserve", /* Specify what JSX code is generated. */ + // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ + // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ + // "types": [], /* Specify type package names to be included without being referenced in a source file. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ + // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ + // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ + // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ + // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ + // "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ + + /* JavaScript Support */ + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ + // "outDir": "./", /* Specify an output folder for all emitted files. */ + // "removeComments": true, /* Disable emitting comments. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ + + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + } +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..ecff439 --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +# Advent of Code + +My solutions in various languages. Mainly used to learn the languages, or new concepts in the languages I am already familiar with. + +## Usage + +### TypeScript + +Move to the `typescript` directory. The main entrypoint is the `runner.ts` file. + +To print both solutions for some dayXX (where XX is from 01-25), enter the following command: + +```bash +# To run the example data input (data/dayXX.example.txt) +# Also, the Y in the `example` flag is for different example files +npx ts-node runner.ts dayXX -eY + +# To run the real data +npx ts-node runner.ts dayXX +``` diff --git a/lib/typescript/combinators.ts b/lib/typescript/combinators.ts new file mode 100644 index 0000000..6016567 --- /dev/null +++ b/lib/typescript/combinators.ts @@ -0,0 +1,10 @@ +export const Y = () => 0; + +export const F = (join: Function, fn1: Function, fn2: Function) => (val: any) => join(fn1(val), fn2(val)); + +export const C = (fn1: Function, fn2: Function) => (val: any) => fn1(fn2(val)); + +export const tap = (fn: Function) => (val: any) => { + fn(val); + return val; +}; diff --git a/lib/typescript/fileReader.ts b/lib/typescript/fileReader.ts new file mode 100644 index 0000000..e7f7cdd --- /dev/null +++ b/lib/typescript/fileReader.ts @@ -0,0 +1,5 @@ +import fs from "fs"; + +type ReadFileToString = (fPath: string) => string; +export const readFIleToString: ReadFileToString = (fPath) => + fs.readFileSync(fPath).toString().trim(); diff --git a/lib/typescript/helpers.ts b/lib/typescript/helpers.ts new file mode 100644 index 0000000..85d5063 --- /dev/null +++ b/lib/typescript/helpers.ts @@ -0,0 +1,16 @@ +export const concatStr = (str1: string, str2: string) => str1 + str2; + +export const strToNum = (str: string) => parseInt(str, 10); + +export const revStr = (str: string) => str.split("").reverse().join(""); + +type Lines = (str: string) => string[]; +export const lines: Lines = (str) => str.split("\n"); + +export const blocks: Lines = (str) => str.split("\n\n"); + +export const getMax = (arr: number[]) => Math.max(...arr); + +export const sortDesc = (arr: number[]) => arr.sort((a, b) => b - a); + +export const take = (n: number) => (arr: any[]) => arr.slice(0, n); diff --git a/lib/typescript/logger.ts b/lib/typescript/logger.ts new file mode 100644 index 0000000..70559d7 --- /dev/null +++ b/lib/typescript/logger.ts @@ -0,0 +1,5 @@ +type Report = (r1: number, r2: number) => void; +export const report: Report = (res1, res2) => console.log(` + Part1: ${res1} + Part2: ${res2} +`); diff --git a/lib/typescript/parsers.ts b/lib/typescript/parsers.ts new file mode 100644 index 0000000..952d574 --- /dev/null +++ b/lib/typescript/parsers.ts @@ -0,0 +1,32 @@ +import { F } from "./combinators"; +import { pipe } from "./reducers"; +import { concatStr, revStr, strToNum } from "./helpers"; +import { exeRegex, regDigits, regDigitsReverse, firstDigitInStr, lastDigitInStr } from "./regExp"; + +const numbersMap = { + "one": "1", + "two": "2", + "three": "3", + "four": "4", + "five": "5", + "six": "6", + "seven": "7", + "eight": "8", + "nine": "9", +}; + +const getIntValue = (str: string) => + parseInt(str) ? str : numbersMap[str as keyof typeof numbersMap]; + +type ExtractFLD = (str: string) => number; +export const extractFirstAndLastDigit: ExtractFLD = pipe( + F(concatStr, exeRegex(firstDigitInStr), pipe(revStr, exeRegex(lastDigitInStr))), + strToNum, +); + +export const extractRealFirstAndLastDigit: ExtractFLD = pipe( + F(concatStr, + pipe(exeRegex(regDigits), getIntValue), + pipe(pipe(revStr, exeRegex(regDigitsReverse)), revStr, getIntValue)), + strToNum, +); diff --git a/lib/typescript/reducers.ts b/lib/typescript/reducers.ts new file mode 100644 index 0000000..3f4ce34 --- /dev/null +++ b/lib/typescript/reducers.ts @@ -0,0 +1,5 @@ +export const pipe = (...fns: any[]) => (input: any) => fns.reduce((acc, fn) => fn(acc), input); + +export const mapR = (fn: Function) => (input: any) => input.map(fn); + +export const sum = (arr: number[]) => arr.reduce((acc, n) => acc + n, 0); diff --git a/lib/typescript/regExp.ts b/lib/typescript/regExp.ts new file mode 100644 index 0000000..2771c03 --- /dev/null +++ b/lib/typescript/regExp.ts @@ -0,0 +1,10 @@ +type ExeRegex = (reg: RegExp) => (str: string) => string; +export const exeRegex: ExeRegex = (reg) => (str) => reg.exec(str)![0].toString(); + +export const regDigits = /(?<=^\w*)(\d|one|two|three|four|five|six|seven|eight|nine)/i; + +export const regDigitsReverse = /(?<=^\w*)(\d|eno|owt|eerht|ruof|evif|xis|neves|thgie|enin)/i; + +export const firstDigitInStr = /(?<=^\w*)\d/i; + +export const lastDigitInStr = /\d(?=\w*$)/i; diff --git a/scripts/mkday b/scripts/mkday new file mode 100755 index 0000000..113c948 --- /dev/null +++ b/scripts/mkday @@ -0,0 +1,39 @@ +#!/bin/bash + +while getopts y:l:d: flag +do + case "${flag}" in + y) year=${OPTARG};; + l) language=${OPTARG};; + d) day=${OPTARG};; + esac +done + +if [[ ! $year || ! $language || ! $day ]] +then + echo "Invalid usage! Required flags are -y, -l and -d"; + echo "Bye..."; + exit 1; +fi + +case $language in + "ts") lang="typescript";; + *) lang="unknown";; +esac + +cd $year + +mkdir -p $lang/day$day + +cp ../templates/$lang/* ./$lang/day$day + +cd ./$lang/day$day + +for f in d*.txt +do + if [[ "$f" =~ ^(d)XX(p[0-9]\.)txt$ ]]; then + mv "$f" "${BASH_REMATCH[1]}${day}${BASH_REMATCH[2]}ts" + fi +done + +mv "index.txt" "index.ts" diff --git a/templates/typescript/dXXp1.txt b/templates/typescript/dXXp1.txt new file mode 100644 index 0000000..98a25c9 --- /dev/null +++ b/templates/typescript/dXXp1.txt @@ -0,0 +1,6 @@ +import { pipe } from "../../../lib/typescript/reducers"; +import { tap } from "../../../lib/typescript/combinators"; + +export const solve = pipe( + tap(console.log), +); diff --git a/templates/typescript/dXXp2.txt b/templates/typescript/dXXp2.txt new file mode 100644 index 0000000..98a25c9 --- /dev/null +++ b/templates/typescript/dXXp2.txt @@ -0,0 +1,6 @@ +import { pipe } from "../../../lib/typescript/reducers"; +import { tap } from "../../../lib/typescript/combinators"; + +export const solve = pipe( + tap(console.log), +); diff --git a/templates/typescript/index.txt b/templates/typescript/index.txt new file mode 100644 index 0000000..fa41326 --- /dev/null +++ b/templates/typescript/index.txt @@ -0,0 +1,4 @@ +import { solve as part1 } from "./d01p1"; +import { solve as part2 } from "./d01p2"; + +export { part1, part2 };