Compare commits
17 Commits
3b9ca8cf2e
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 437b05d88b | |||
| 2eddd7fdc2 | |||
| 0a08ad2cae | |||
| b1c43e46fc | |||
| 7ffccf5e5e | |||
| f91772c4bf | |||
| bf0d592eba | |||
| 161ba78efe | |||
| b67163521e | |||
| 1c1252c4e1 | |||
| 1bb8b40e36 | |||
| 7928c2334f | |||
| 87bacd3b4c | |||
| cfbb3888f8 | |||
| 60eaa81180 | |||
| 0b64a90112 | |||
| ba824eadbe |
34
Cargo.lock
generated
34
Cargo.lock
generated
@@ -5,34 +5,28 @@ version = 4
|
||||
[[package]]
|
||||
name = "AdventOfCode2025"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"day01",
|
||||
"day02",
|
||||
"day03",
|
||||
"day04",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "day01"
|
||||
version = "0.1.0"
|
||||
|
||||
[[package]]
|
||||
name = "day02"
|
||||
version = "0.1.0"
|
||||
|
||||
[[package]]
|
||||
name = "day03"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"iter-first-max",
|
||||
"itertools",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "day04"
|
||||
version = "0.1.0"
|
||||
name = "either"
|
||||
version = "1.15.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
|
||||
|
||||
[[package]]
|
||||
name = "iter-first-max"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "42ace18d32276b4ce7d8261c06b376398a4ea82e4715a5b37e46fddbff41a617"
|
||||
|
||||
[[package]]
|
||||
name = "itertools"
|
||||
version = "0.14.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285"
|
||||
dependencies = [
|
||||
"either",
|
||||
]
|
||||
|
||||
@@ -4,7 +4,5 @@ version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
day01 = {path = "src/day01"}
|
||||
day02 = {path = "src/day02"}
|
||||
day03 = {path = "src/day03"}
|
||||
day04 = {path = "src/day04"}
|
||||
itertools = "0.14.0"
|
||||
iter-first-max = "0.1.2"
|
||||
32
README.md
32
README.md
@@ -1,13 +1,27 @@
|
||||
# Advent of Code 2025
|
||||
```bash
|
||||
day01:A => 1150 ( 130us)
|
||||
day01:B => 6738 ( 161us)
|
||||
day02:A => 31839939622 ( 14191us)
|
||||
day02:B => 41662374059 (135384us)
|
||||
day03:A => 16812 ( 154us)
|
||||
day03:B => 166345822896410 ( 356us)
|
||||
day04:A => 1518 ( 304us)
|
||||
day04:B => 0 ( 9us)
|
||||
day01:A => 1150 ( 36us)
|
||||
day01:B => 6738 ( 48us)
|
||||
day02:A => 31839939622 ( 5135us)
|
||||
day02:B => 41662374059 ( 47939us)
|
||||
day03:A => 16812 ( 54us)
|
||||
day03:B => 166345822896410 ( 148us)
|
||||
day04:A => 1518 ( 139us)
|
||||
day04:B => 8665 ( 2198us)
|
||||
day05:A => 701 ( 109us)
|
||||
day05:B => 352340558684863 ( 13us)
|
||||
day06:A => 6503327062445 ( 117us)
|
||||
day06:B => 9640641878593 ( 66us)
|
||||
day07:A => 1678 ( 21us)
|
||||
day07:B => 357525737893560 ( 28us)
|
||||
day08:A => 0 ( 0us)
|
||||
day08:B => 0 ( 0us)
|
||||
day09:A => 4725826296 ( 99us)
|
||||
day09:B => 0 ( 0us)
|
||||
day10:A => 452 ( 243us)
|
||||
day10:B => 0 ( 0us)
|
||||
day11:A => 636 ( 189us)
|
||||
day11:B => 636 ( 162us)
|
||||
----------
|
||||
150768us
|
||||
56910us
|
||||
```
|
||||
1186
puzzles/input05.txt
Normal file
1186
puzzles/input05.txt
Normal file
File diff suppressed because it is too large
Load Diff
5
puzzles/input06.txt
Normal file
5
puzzles/input06.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
6 25 26 18 71 23 9 444 224 56 69 132 3 179 3 53 97 75 325 1 61 18 9 57 53 11 3785 91 6 815 24 3 1238 1 241 77 56 754 43 48 6539 15 22 4 56 5 57 219 251 66 8198 3 5 74 62 4787 568 551 275 3 931 8 5139 531 992 6499 5 79 9889 29 2 8 44 14 897 58 8973 135 445 48 537 168 68 5 5 55 32 966 58 23 27 68 46 8836 14 49 2858 7 8 478 77 67 543 9 958 845 142 64 97 4 591 85 79 73 85 545 999 9 5 84 29 66 245 762 128 9 678 6 474 9338 84 83 564 964 195 63 66 38 6749 666 526 6561 26 76 6 27 254 31 4 44 9 78 5536 56 754 5 5122 94 4 961 3 53 618 991 89 57 468 682 72 47 916 35 5 7237 3 9 26 8 741 849 63 513 58 129 113 69 451 92 372 71 85 398 96 84 25 429 76 12 74 6 89 2 27 5 5125 1 6522 868 137 3496 8 537 92 314 34 71 492 25 989 1977 912 26 7 2938 23 21 784 572 842 99 558 6 316 63 57 1 47 6 15 1796 2 7 53 622 88 16 5 4 7 89 25 6 952 9 17 76 4 51 39 3 3 9 6353 435 86 8526 26 313 14 35 59 77 8 192 7353 76 7 728 5 114 99 3654 829 1 11 38 9648 52 9761 51 8 3 6 29 73 4 75 233 2 52 52 362 7 1269 375 18 795 13 66 33 8 465 35 347 43 75 343 6491 48 8 45 7 9567 471 559 165 86 1998 95 8 817 54 89 72 53 757 51 94 1424 6 1544 27 66 79 28 763 3 95 7 288 2 171 81 119 923 57 96 58 913 8869 42 35 8 49 2 78 2 6 261 87 34 414 553 9 53 13 41 7371 129 38 9 684 7356 357 249 21 77 19 454 698 13 93 976 83 758 28 5 79 17 25 48 5841 98 22 36 6 682 7932 289 67 72 858 692 9 52 26 13 7 527 74 39 56 43 811 55 4 778 7965 37 6957 74 526 96 4 56 284 53 7137 1 97 3412 3 385 87 39 8 63 1 6 86 13 62 5 34 71 69 3 27 948 9935 26 33 967 2 8 87 89 22 9 3 63 8 12 3 62 28 43 2 11 775 773 3 85 12 124 48 51 2321 213 9 83 4 38 4 32 75 84 38 5 225 63 9 66 1974 88 362 1 21 97 43 57 46 81 9 3813 127 78 66 3 181 451 163 315 3 44 18 617 12 822 8439 74 4 833 565 4 83 852 885 365 849 41 41 1884 27 561 24 2 92 75 376 3156 5151 86 322 2 1 19 65 618 3782 548 825 28 45 6935 47 9 46 1 1624 1138 869 57 165 3212 271 929 964 37 917 19 4 351 53 55 47 952 966 95 6 751 8986 116 5 948 29 71 8 85 14 87 58 8495 5431 852 35 91 94 3 487 548 87 76 5 145 26 48 18 1789 2 9 76 538 597 34 4 3 96 9 956 263 3 43 9 96 8438 5 4 63 41 3 699 39 578 19 259 454 89 969 857 281 1 6 164 36 57 57 1 345 399 2 33 188 976 6776 25 46 79 17 85 9 276 42 922 19 58 3955 7 5625 46 5392 5639 421 833 925 53 41 4 78 51 817 4627 9 49 559 925 85 11 85 6 5776 51 796 49 423 86 698 6 28 7835 49 7932 56 14 4219 386 8 987 348 468 14 114 42 1628 99 134 95 8 159 43 3 42 2316 249 63 358 97 29 966 826 651 6746 284 164 155 71 9 22 26 73 6 68 76 13 1 9 57 49 6 83 57 724 225 79 853 357 61 4988 74 58 8 4 73 627 171 846 79 6 188 67 6 76 2 7574 1 42 69 2648 64 28 92 3 31 6 25 8 26 6 37 458 2797 31 5 3234 87 475 2924 75 87 997 8954 396 532 76 4 7 129 36 675 12 7 713 62 7 17 823 71 27 7 933 25 9 6 6633 3567 35 31 63 133 456 421 51 99 35 235 16 7 766 425 147 3 761 248 296 292 6 811 4 99 94 75 7 272 355 63 239 666 1 326 38 69 63 8 668 45 24 936 773 4 23 5323 91 617 716 89 69 63 685 5 884 37 9 878 96 634 9 29 564 4 228 82 7 2522 556 12 19 44 822 67 71 4 286 87 92 19 2 61 63 79 9255 2 2331 63 35 324 5 78 187 18 21 96 53 156 6 64 8 24 7 114 326 146 73 56 97 42 978 9 85 71 24 33 29 329 748 63 629 75 4925 833 224 478 23 14 53 55 5 84 6246 6 42 893 85 6611 5 764 56 118 2388 24 63 6 329 672 62 27 949 143 62 2 88 8 5119 42 659 67 916 16 71 37 95
|
||||
61 34 67 19 359 18 53 794 654 86 924 979 483 314 3 97 92 46 169 6 87 596 7 25 35 39 36 289 17 416 26 41 3411 71 979 37 49 792 84 34 4456 87 24 1 37 5 51 25 263 3 1197 33 7 93 68 7432 894 671 363 59 887 5 5556 592 947 166 86 946 5263 828 55 652 29 95 516 33 977 797 862 86 998 418 49 6 549 69 4849 639 3 54 75 57 32 2469 11 56 1587 78 61 868 64 95 443 98 273 782 163 64 15 12 436 855 78 68 12 959 216 98 4 55 32 3222 512 695 57 8 31 33 262 8878 33 95 589 756 564 429 762 59 7299 772 462 732 54 26 4 58 821 26 61 46 83 57 615 16 44 65 8315 37 99 118 4 52 883 388 88 541 743 933 75 28 144 77 21 7832 1 563 359 85 375 521 54 429 91 57 945 66 273 84 448 74 93 485 91 65 13 619 255 19 76 45 69 76 14 34 823 65 2776 933 96 5123 8 192 97 196 18 22 989 94 927 3333 531 94 24 6947 19 739 3352 819 852 87 178 477 325 56 17 1 14 2 957 8691 79 88 21 826 21 14 45 48 59 39 892 68 463 91 39 24 39 65 21 15 68 929 533 649 91 5834 45 1862 48 12 41 42 393 928 4253 95 5 834 29 427 42 8951 858 54 552 29 2749 94 198 92 7 37 125 69 55 129 97 799 2 854 94 85 74 7578 271 35 584 99 13 36 618 325 12 823 26 314 695 7666 89 16 55 42 3858 5436 486 81 65 4471 87 144 321 557 26 28 42 229 844 922 8761 58 6794 81 337 16 4597 775 7 8497 68 835 68 123 359 437 9878 98 96 38 978 8544 79 38 67 58 451 888 93 72 822 96 72 5774 324 54 87 7 54 347 965 6941 34 923 3777 266 856 41 515 7 496 582 95 18 858 96 6549 45 783 63 56 438 41 2519 76 25 57 8 839 2681 59 21 16 288 635 255 75 37 2263 64 883 29 81 396 98 812 5 2 23 3737 35 143 39 183 89 39 324 153 73 2477 89 62 993 114 946 82 85 64 39 7 68 27 447 28 88 38 62 87 1 3786 614 5524 42 13 569 39 82 96 42 95 462 3 223 19 65 76 1155 47 19 4 324 726 166 93 373 12 145 5 69 8416 973 49 89 38 63 6 17 33 57 72 99 41 25 6 12 8679 81 772 565 39 18 51 66 79 56 12 8614 638 87 36 17 882 771 354 47 63 34 79 2581 62 477 9571 16 84 851 59 29 35 118 176 46 961 73 45 7467 89 478 21 518 88 41 122 1745 2934 21 371 68 55 26 64 268 3519 659 425 5 57 778 22 9 81 9 7951 1364 822 95 539 7885 468 153 391 33 899 61 89 385 83 36 56 864 157 836 57 125 512 568 625 138 393 767 2 85 55 876 11 3236 8368 459 82 833 86 45 444 883 22 2 25 256 65 77 949 2799 12 3 58 9517 236 57 9 1 83 8 6731 4193 36 67 4 87 1685 77 58 8226 46 52 293 47 442 68 682 976 23 671 543 134 4 93 523 78 32 78 1 748 918 33 47 498 852 8552 34 75 99 18 64 44 941 45 842 91 32 1676 3 865 75 1747 3693 936 724 681 64 66 28 574 83 676 9246 8 95 4386 9153 56 227 86 9 1245 48 862 348 629 454 378 12 43 7377 98 723 92 35 5224 486 88 649 417 752 2971 675 71 3465 35 36 46 84 478 7671 12 27 23 841 42 145 24 48 593 3245 266 3656 928 939 676 31 425 41 283 81 77 615 33 21 85 98 86 22 83 72 89 172 2864 87 585 2293 167 4365 66 63 5 7 823 996 239 269 88 1 647 424 9 32 8 1727 77 91 35 5829 118 63 69 67 5486 365 34 5 31 98 495 183 3464 88 8 7983 21 712 6764 15 96 434 61 313 329 51 38 53 976 715 183 44 8 2745 397 67 48 535 77 73 632 296 22 97 7447 8252 7818 47 162 61 438 612 696 84 757 32 596 68 8 358 387 1277 9 171 795 273 393 218 21 135 262 22 185 9 923 6764 85 432 3844 3 973 9 26 77 886 995 661 63 588 926 6 48 597 572 665 779 84 4 34 134 1 81 77 46 528 95 171 11 27 752 57 457 3479 2 9241 241 28 48 27 68 4913 83 26 626 851 13 72 9 477 193 48 4957 53 2385 72 92 914 7 1955 419 53 5 96 28 627 72 23 46 553 2 398 4168 668 88 89 42 681 514 55 96 65 71 12 27 6144 78 893 987 72 6183 984 431 97 26 88 32 44 41 262 6464 9 82 8613 18 7171 93 761 511 662 1279 95 71 43 65 243 57 18 613 611 47 7 8536 14 2483 51 294 364 558 1712 52 855 171
|
||||
32 79 35 6 654 52 12 7847 214 69 883 793 5716 821 5 3 99 7393 139 48 83 735 32 71 6 4 87 615 29 19 67 21 4147 98 455 79 865 954 62 26 8395 81 16 94 92 77 64 46 65 2 72 74 38 93 19 5866 2 92 673 675 339 14 4993 46 799 1 37 7413 9754 5163 64 5774 3 56 774 87 857 395 597 66 675 3943 86 68 537 22 1385 218 8 2 2 55 595 154 11 31 476 6795 35 489 84 13 7226 54 934 227 277 67 7 12 338 2774 82 48 41 1 798 78 3 97 22 3845 913 751 49 55 81 52 598 87 521 974 23 89 519 8819 632 69 664 187 225 362 51 76 5 62 811 77 37 87 58 66 79 25 75 563 2868 52 91 792 3 16 3 983 55 3198 552 169 65 54 49 33 81 26 36 899 446 27 222 177 547 915 33 37 221 47 66 24 917 14 94 394 482 69 13 279 253 98 4518 38 48 41 95 958 318 52 8771 227 46 117 96 54 88 579 94 42 127 28 637 5943 47 817 61 624 287 683 4274 3 31 657 772 673 958 16 5 52 75 42 768 776 94 44 326 141 16 768 94 25 187 35 975 41 834 64 728 81 35 79 414 48 225 921 98 44 475 3974 1 7378 47 567 97 7 6219 877 621 973 56 544 88 427 7 119 121 31 871 67 3278 79 335 88 95 149 659 65 578 152 28 34 428 2812 83 92 46 689 394 15 153 91 42 27 574 921 528 99 68 321 598 7466 36 46 55 38 753 3788 3 2 56 2162 99 8823 73 848 8 87 31 28 189 286 386 47 2848 75 937 65 4767 697 68 1252 76 973 674 75 392 962 3297 3 37 96 29 5673 99 355 67 5 321 527 83 94 33 7 358 4469 491 489 27 3 74 538 8945 5422 45 42 7897 7 18 41 2453 9 65 564 747 15 522 86 9879 667 376 64 12 913 59 7289 85 61 1 52 972 27 21 71 49 162 451 936 57 86 3836 714 392 644 18 985 25 968 5 266 57 1532 45 594 61 5798 32 283 366 23 89 963 22 22 951 556 24 32 49 14 22 25 79 77 651 65 7232 49 56 96 6 8195 361 5222 82 87 125 85 5215 93 6 23 3698 76 999 973 32 16 1751 33 73 72 237 814 656 82 1655 89 563 3 55 257 53 78 78 74 37 27 966 69 497 53 113 94 63 57 76 7515 84 89 358 1 299 94 43 21 48 2995 958 1532 66 63 78 675 129 886 78 22 494 894 2735 11 783 6543 1 61 7936 63 97 57 676 594 48 518 16 35 436 33 951 28 424 45 27 737 3799 6746 58 2 14 989 74 34 283 891 55 812 4 78 326 89 778 17 371 6129 387 755 55 82 9381 742 96 647 99 946 48 18 986 25 93 97 731 265 646 46 983 543 9 4263 898 694 4929 75 8 325 439 17 29 71 779 9 2534 29 746 127 4 6 6 314 895 86 61 459 847 24 838 697 1933 526 89 23 49 181 89 5277 5287 25 7 79 79 1519 21 99 8267 25 73 36 424 9 8273 592 9155 721 675 29 567 79 411 914 63 99 833 81 257 421 978 2 253 214 5444 87 65 16 832 85 45 463 56 95 35 53 1297 54 574 12 7637 616 696 521 892 147 47 17 882 25 225 2336 55 27 8151 6684 28 322 39 86 569 67 494 9253 45 977 655 249 8 15 575 857 81 72 6927 69 62 68 282 844 1849 23 43 255 18 17 39 46 58 2374 82 62 41 565 49 837 19 39 474 1219 78 98 11 54 863 92 923 65 417 98 52 786 63 36 38 88 772 81 21 38 17 87 3984 53 381 4497 922 5282 96 68 1 18 188 157 964 429 99 56 214 898 33 77 98 838 88 21 748 7835 539 2 29 17 3776 916 61 72 98 39 281 192 14 67 765 7897 39 741 1358 86 33 87 76 46 383 15 2994 196 46 524 825 41 653 6487 7457 63 16 817 94 6 652 524 232 444 6579 9359 8982 99 339 24 25 597 517 85 564 57 52 1 31 31 458 1781 22 59 753 783 848 842 13 194 359 47 574 38 552 9228 7 3 1885 5 76 6 1 743 3466 853 6425 13 337 68 1 82 454 227 681 287 41 8 38 441 1 5 23 66 432 88 534 47 74 892 392 851 9797 3 7123 5 819 93 47 18 4256 416 59 359 777 9 87 52 274 891 43 9653 7564 8681 37 17 99 9 2378 143 579 1 77 581 91 313 97 278 863 81 232 8384 389 41 96 88 179 618 29 4 62 58 58 64 9939 38 631 346 46 3685 98 415 78 633 41 83 82 672 5384 7844 97 592 5823 35 815 37 938 186 11 915 83 79 155 65 68 191 93 232 392 935 76 6443 99 7273 56 412 898 521 1581 69 434 873
|
||||
56 487 56 3 128 43 437 6351 7 17 145 354 6554 614 49 2 69 3666 4 24 7 875 881 96 1 8 65 264 73 63 59 45 1469 81 455 84 179 37 6422 13 51 11 66 246 66 66 26 92 87 7 73 84 85 66 41 91 5 39 37 439 97 72 6 29 96 2 88 3165 1485 2645 25 8918 2 17 552 39 17 344 16 7 76 7434 24 12 796 89 4668 395 4 5 4 447 986 954 2 38 515 8976 33 649 11 33 1511 92 17 33 365 7 7 49 17 9768 17 26 52 6 53 86 99 698 54 7594 193 22 31 32 11 59 283 8 459 781 8 6 898 2436 721 47 9 613 922 768 15 88 46 89 417 37 55 754 29 86 69 99 32 791 141 97 79 986 24 96 7 4 6 2182 554 142 15 64 17 29 82 71 63 293 171 14 1 233 577 798 8 86 932 7 86 4 415 83 169 262 194 66 86 929 914 85 1816 86 17 37 44 578 71 83 188 213 22 721 77 57 98 693 55 8 1 45 26 9273 7 565 68 291 937 897 7575 8 63 359 741 734 297 28 1 47 8 29 696 493 84 65 577 237 29 479 87 47 582 91 153 34 747 28 466 55 61 33 518 66 235 367 74 28 987 525 9 3927 8 125 14 8 7744 611 588 957 63 43 32 418 3 78 1 15 7442 1 31 86 24 76 91 837 722 43 238 882 45 3 856 3699 72 42 49 85 2557 15 75 11 81 32 928 833 221 63 4 327 49 26 43 38 6 56 66 5482 7 6 46 42 73 5196 82 9583 1 65 45 95 389 228 4 57 8889 8 531 8 7555 143 77 2864 63 59 999 55 291 6 3989 3 1 26 42 793 2 153 44 6 583 6875 38 59 58 5 744 8968 174 747 2 3 5 346 7766 1274 97 42 854 1 35 53 2687 1 76 29 536 5 13 94 2882 145 966 97 55 418 67 219 95 22 3 41 57 6 69 28 97 21 556 443 83 78 6627 632 827 958 12 449 56 629 4 442 1 499 62 84 8 7985 6 127 641 91 5 135 15 22 11 341 61 766 6 37 5 97 27 38 763 56 2647 88 65 4 39 1194 617 993 47 53 591 24 8719 79 3 6 2267 13 556 661 22 547 2214 37 69 92 769 995 474 52 7439 11 61 8 16 1 77 22 37 24 2 78 898 55 583 71 153 77 4 23 35 94 2 3 718 8 794 13 73 9 9 1212 1 4563 41 8 78 39 939 319 75 85 864 523 5557 44 97 98 8 43 1744 92 18 95 432 6 21 252 54 1 48 28 283 13 774 5 94 363 513 52 13 3 24 568 63 2 626 8 7 825 1 19 18 4 624 8 657 93 2 246 16 32 752 99 9 4 45 534 32 651 5 53 33 3 778 353 546 39 296 42 5 8366 5819 751 7542 52 7 546 836 31 7 11 616 4 6251 11 777 13 9 9 5 442 495 93 8 431 86 83 3273 551 7852 43 3 35 39 757 27 3864 1262 27 6 24 71 8693 56 89 2683 58 265 2 5433 3 6621 47 5855 579 88 2 623 31 231 83 16 7 375 56 153 333 131 5 9 326 5427 34 97 7 329 63 43 62 65 3 58 73 13 47 225 66 78 139 29 392 6 277 1 365 646 79 68 36 75 11 4216 7425 6 438 89 99 974 83 953 4317 21 944 55 435 8 7 748 41 21 2 812 52 55 16 745 44 4288 5 81 436 1 45 36 847 6 6311 79 64 6 772 16 345 76 4 788 2968 38 41 8 6 256 5 149 69 682 38 18 379 35 5 37 188 482 8 17 34 36 4 9141 5 56 5978 431 626 545 57 38 166 525 9 255 956 17 37 356 866 48 3 41 7 79 19 6554 112 328 7 92 88 9515 1296 67 42 85 46 473 94 4 39 441 93 43 7 197 48 7 5 4 54 42 68 3667 835 95 662 598 48 441 8473 9641 194 99 927 45 6 967 965 582 568 8387 4454 461 2 155 2 5 421 445 6 4359 89 5 8 64 78 634 1227 67 68 567 776 81 587 43 447 297 87 429 21 36 2739 5 1 8376 39 35 8 2 952 4642 875 1624 42 732 6 16 82 15 385 331 539 44 9 11 539 47 9 4 83 46 56 949 14 83 58 167 787 5446 84 6559 2 294 78 1 81 4649 433 81 9 354 4 78 52 985 9932 84 84 4189 9 88 3 6 67 9929 542 984 9 3 332 66 579 67 755 183 36 95 9926 72 49 21 89 211 96 28 3 47 5 65 79 1996 28 193 66 54 5459 47 88 8 789 73 87 74 632 2176 4 28 324 6726 76 96 49 177 499 8 954 52 5 524 45 28 955 96 23 32 432 59 6364 33 25 66 73 632 231 6632 53 648 657
|
||||
* + * + * + * + * * + * + * * * + + * + * * + * + * + * * * * * + * + + * * + + + + + + * + + * * * + * + * + + * * * + + * + * * + * + + + + + + + * * + * * + + + + * * * + * * + + + + + * + + + * * + * + * + * * * * * * + * + * * * + * + + + * * * * * + * + * + + * + + + + + + + + + * * * + + * * + * + + * * + * * + * * + + * + * + * + * + * + + + + + + + * * * * * * + * + * * * + + + * + * + + + * + * + * + * * + + * * + + * * + + + + + + + * * + * * + * + * * + + * + + + * * * + * * + + + * + * * + * * + * * * * * + * * + + + + + * + + * + * * + + * + + * * + * + * + + * * * * * * * + + + + * * + + + * + * * + + * + + * + + + + * + + + * * * + * + * + * * * + * * + * + * + * + * + + + * * + + * + * * * * + + * * * * + * * * * + + * * * + + + + + * * + + + * + + + * * * * + + * * * + + * + * * * + + + * + * * * * + * + * + * + * * * + * * + * + * + * * * + * + + * + * * * * + * * * * * + + * * + + + + + * + * * + * * + + + * * * * + + + * + * + * + + + * * + * + + * * * * + * * * * * * * + + * * + * * + * + + + + * + * * + + * + + * + + + + * + + + * * + * * + * * + * * * + + * * + + * * + * * + * + * * * + + * + + + + + + * * + + * + * * * * * * + * * + * + * + + + + * + * + * + * + + * * + * * * * + * * + * * + + + + + + * * + * * * + + + + * * + * * + + * + + * + * + * + + * + * * * + * * + * * * * + + * * * * * * + + * + * + + + + + + + * + * + + + + * + + * + + * + * * + + + + + * * * + + + + * * + + * * + * + + * + + * * + * + * * + + * + * + + + * + * * + + * * + * * * * + + + * * * * * + + + * + + + * + * + * * + * * + * + + * * + * * + + + + + * + + * * * * * * + + * + * + + + * * + * * + + * + + + * * + + * * * * + + * + + + + + + * + * * * + + * + * + * * + + * * + * * + * * + * * + + + * + * + * * * + * + * + * * + + * * * * + * * * + * * * + * * * + * * + * + + * * * + + * * + * + * * * + * + + + * * * + + * * * + * + * + * + * + + + + + + * * + * * * * * + * + * * + * * * * + * * + + + + * + * + * * * + + + + * + + * + * * + * + + + * + + * + * * *
|
||||
142
puzzles/input07.txt
Normal file
142
puzzles/input07.txt
Normal file
@@ -0,0 +1,142 @@
|
||||
......................................................................S......................................................................
|
||||
.............................................................................................................................................
|
||||
......................................................................^......................................................................
|
||||
.............................................................................................................................................
|
||||
.....................................................................^.^.....................................................................
|
||||
.............................................................................................................................................
|
||||
....................................................................^.^.^....................................................................
|
||||
.............................................................................................................................................
|
||||
...................................................................^.....^...................................................................
|
||||
.............................................................................................................................................
|
||||
..................................................................^.^.^.^.^..................................................................
|
||||
.............................................................................................................................................
|
||||
.................................................................^.^.^.^.^.^.................................................................
|
||||
.............................................................................................................................................
|
||||
................................................................^.^.^...^.^.^................................................................
|
||||
.............................................................................................................................................
|
||||
...............................................................^.....^.^...^.^...............................................................
|
||||
.............................................................................................................................................
|
||||
..............................................................^.^.^.^.^.^.^.^.^..............................................................
|
||||
.............................................................................................................................................
|
||||
.............................................................^.^.^.^.....^.^...^.............................................................
|
||||
.............................................................................................................................................
|
||||
............................................................^.^...^.^.^.^.^...^.^............................................................
|
||||
.............................................................................................................................................
|
||||
...........................................................^.....^.^.^...^.^.^.^.^...........................................................
|
||||
.............................................................................................................................................
|
||||
..........................................................^.^.^.^.^.^.^.^...^.^...^..........................................................
|
||||
.............................................................................................................................................
|
||||
.........................................................^.^.^.^.^.^...^...^.^.^...^.........................................................
|
||||
.............................................................................................................................................
|
||||
........................................................^.^.^.^.^.^.^.^.......^.^.^.^........................................................
|
||||
.............................................................................................................................................
|
||||
.......................................................^.^.^.....^...^...^.^...^...^.^.......................................................
|
||||
.............................................................................................................................................
|
||||
......................................................^.....^.^.^.^.^.^...^.^.^.^...^.^......................................................
|
||||
.............................................................................................................................................
|
||||
.....................................................^.^...^...^...^.^.^.^...^.....^.^.^.....................................................
|
||||
.............................................................................................................................................
|
||||
....................................................^.^.^.^...^...^.^.^.^.^.^.^.^.^...^.^....................................................
|
||||
.............................................................................................................................................
|
||||
...................................................^.^...^.^.^.......^.^.^...^...^.^.^.^.^...................................................
|
||||
.............................................................................................................................................
|
||||
..................................................^...^.^.^.^.^.^.^.^.^.^.^...^...^.....^.^..................................................
|
||||
.............................................................................................................................................
|
||||
.................................................^.^.^...^.^.^.^...^.^.^...^.^.^...^...^.^.^.................................................
|
||||
.............................................................................................................................................
|
||||
................................................^.^.......^...^...^.^...^...^.^.^.^.^.^.^...^................................................
|
||||
.............................................................................................................................................
|
||||
...............................................^.^...^.^.....^...^.^.^.^.^.^.^.^.^.^.^.^...^.^...............................................
|
||||
.............................................................................................................................................
|
||||
..............................................^.^.^.^.^.^.^.^.^...^.^.^.^.^.^.^.^.....^.^...^.^..............................................
|
||||
.............................................................................................................................................
|
||||
.............................................^.^.^...^.^...^.^.^.^.^.^.^.^.....^.^.....^.^.^.^.^.............................................
|
||||
.............................................................................................................................................
|
||||
............................................^...^.....^.^.^...^.^...^.^.^.^...^.^.^.^.^.^...^.^.^............................................
|
||||
.............................................................................................................................................
|
||||
...........................................^.^.^.^.^.^...^...^.^.^...^.^.^.^.^...^.^.....^.^.....^...........................................
|
||||
.............................................................................................................................................
|
||||
..........................................^.^...^...^.^.^.^.^...^.^...^.^...^...^.^.^...^.^.^.^...^..........................................
|
||||
.............................................................................................................................................
|
||||
.........................................^.^.^...^.^.....^.^.........^.^.^.^.......^.^.^.......^.^.^.........................................
|
||||
.............................................................................................................................................
|
||||
........................................^...^...^.......^.^.......^...^.^.^.^...^.^.^.^.^.^.^.....^.^........................................
|
||||
.............................................................................................................................................
|
||||
.......................................^...^.^.....^...^.^.^.^.^.^.^.^.^.^...^.^.^.^.^...^...^.^.^.^.^.......................................
|
||||
.............................................................................................................................................
|
||||
......................................^.^.^.....^.^...^.^.^...^...^.....^.^...^...^...^.^.....^.^...^.^......................................
|
||||
.............................................................................................................................................
|
||||
.....................................^.^.^.^.^.^.^.....^.^...^...^.^.^...^...^.^.^.^.^.^.^.^.^...^.^...^.....................................
|
||||
.............................................................................................................................................
|
||||
....................................^...^.^.^.^...^...^.^...^.^.^.^.^...^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^....................................
|
||||
.............................................................................................................................................
|
||||
...................................^.^.^.^.............^.....^.^...^...^.^.....^.^...^.^...^.^.^...^.^.^.^...................................
|
||||
.............................................................................................................................................
|
||||
..................................^.^.....^.^.^.^.^.^.^.^.....^.^...^.^...^.......^.^.^.....^.^...^.^.^.^.^..................................
|
||||
.............................................................................................................................................
|
||||
.................................^.^.^.^.^.^.^.^.^.^...^.^.^.^.......^...^.^...^.^...^.^.^.^.....^.^.^.^.^.^.................................
|
||||
.............................................................................................................................................
|
||||
................................^.^...^.^.^.^.^.^.^.^.^...^.^.^.^.^.^.^...^.^...^...^.^...^.^.^.^...^.^.^...^................................
|
||||
.............................................................................................................................................
|
||||
...............................^.....^.^.^.......^.^...^...^.^.^.^.^.^...^.^.^.^.^...^.^.^...^.^...^.^.^.^.^.^...............................
|
||||
.............................................................................................................................................
|
||||
..............................^.^.^.^.......^...^.^.^...^.^...^...^.^.^...^.^...^.^.^.^...^...^.^.^...^.^.^.^.^..............................
|
||||
.............................................................................................................................................
|
||||
.............................^...^.....^...^.^.^.^...^...^.^.^.^.^...^.^.^.^.^.^.^.^...^.^.....^.......^...^.^.^.............................
|
||||
.............................................................................................................................................
|
||||
............................^.^.^.^.^.^.^...^...^.^...^.^.....^.^...^.^...^.^...^.^.^.^...^.....^...^.^.^.^.^...^............................
|
||||
.............................................................................................................................................
|
||||
...........................^.^.^.....^.^.^.....^.^.^.^.^.^.^...^.^.^.^.^.^.....^.^...^...^.^.^.^...^...^.....^.^.^...........................
|
||||
.............................................................................................................................................
|
||||
..........................^...^.^.......^.^.^.^.^.^...^.^.^.^.^.^.....^...^...^...^...^...^.^...^.^...^.^.^...^.^.^..........................
|
||||
.............................................................................................................................................
|
||||
.........................^.^.^.^.^.^...........^.^.^.^...^.^.^.^.^...^.....^.^.^.^.^.^.......^.^.^...^.^.^...^.^.^.^.........................
|
||||
.............................................................................................................................................
|
||||
........................^.^.....^.^.^...^.^.^...^...^.^.^.^...^.....^.....^.^...^.^.^...^.^.^.^.^...^.^.^.^...^.^...^........................
|
||||
.............................................................................................................................................
|
||||
.......................^.^.^...^.^.^.^.....^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^...^.^.^.^.^.^...^.^.^.^.^.^.^.^.^.^...^.^.^.......................
|
||||
.............................................................................................................................................
|
||||
......................^...^.^.^...^.^...^.^...^.^.^...^.^.^...^.^.^.^.^...^.^.^.^...^.^.^.....^.^.^...^.^...^.^.....^.^......................
|
||||
.............................................................................................................................................
|
||||
.....................^.^.^.....^...^...^.^.^.^.^.^.^.^...^.^.^.^...^.^.^.^...^.^.^.^.^.^...^.....^.^.^.^.^.^.....^.^...^.....................
|
||||
.............................................................................................................................................
|
||||
....................^.^...^.^...^.^.^.^...^.....^...^.^...^.^.^.^.^.^.^.^.^.^.^.....^.^.^...^.^.^...^...^...^.^.^.^...^.^....................
|
||||
.............................................................................................................................................
|
||||
...................^.^...^.^.....^.^...^.^...^.^.^.^...^.^.^.^.^.....^.^.^.......^.^.^.^...^...^.^.^.^.^.^.^.^.^.^.....^.^...................
|
||||
.............................................................................................................................................
|
||||
..................^.^.^...^.^.^...^.....^.^.^.....^.^...^.^.^.^.^.^.^...^.^.^.^.^.^.^.........^.^.^.^.^.^.^.^.....^.^.^.^.^..................
|
||||
.............................................................................................................................................
|
||||
.................^...^.^.^.^.^.^...^.^.^.^.^.^.^.^.^.^.^.^.....^...^.^.^.^.....^.^.^.^.^...^.^...^...^.^...^.^.^.^.^...^...^.................
|
||||
.............................................................................................................................................
|
||||
................^.^.......^.........^.^.....^.^.^.^.^.^.^.....^...^.^.....^.^.^.......^.^...^.^.^.^.^.^.^.....^.^...^.^.^.^.^................
|
||||
.............................................................................................................................................
|
||||
...............^...^.^...^.....^.^.^.^.^.^.^.^...^.^.^.........^.^.^.^...^.^.^.^.^.^.^.^.....^.^.^.^.^.^.^.^.^.^.^.^.......^.^...............
|
||||
.............................................................................................................................................
|
||||
..............^...^.^.^.^.^.^.^.^...^.^.^...^.^.^.^...^...^...^...^.^.....^...^.^.^.^.^.^.^.....^.^.^...^...^.^...^.^.......^.^..............
|
||||
.............................................................................................................................................
|
||||
.............^.......^.^.^.^...^.^...^.^.^.^...^.^.^.^.^.^.^.^.....^.^...^...^...^.^.^...^.^...^.^.....^.^...^.^...^...^.^.^.^.^.............
|
||||
.............................................................................................................................................
|
||||
............^.....^.^.^.^.^.^.^...^.^.^.^.^.^.^.^.^.^.^.....^.....^.^...^...^.......^.....^...^...^.^.^.^.^.^.^.....^...^.^.^.^.^............
|
||||
.............................................................................................................................................
|
||||
...........^...^.^.^...^...^.^.^.^.^.^.^.^.^.....^.^.........^...^.^...^.^.^.^...^...........^.^.^.^.....^...^.^.^.^.^...^...^.^.^...........
|
||||
.............................................................................................................................................
|
||||
..........^.^.^.........^.^.^.^.....^.^.^.^.^.^.^.^.....^.^.^...^.^.^...^.^.^.^.^.^.^.^.^...^...^.^.^.^.^.^.^.^.^.^.^...^.^...^...^..........
|
||||
.............................................................................................................................................
|
||||
.........^.^.^.....^.^.^...^.....^.^.^...^.....^...^.^.^...^.....^...^.^.^.....^.^.^...^.^.......^.^.^.....^.^.^.^.^...^.^...^...^.^.........
|
||||
.............................................................................................................................................
|
||||
........^.^.^.^.^...^...^.^...^.^.^.^.^.^...^.^.^.^.....^.^.^.^.^.^.^.^.^.^.............^.^.^...^.....^.^...^.^.^.^.^.^.^.^.^.^.^.^.^........
|
||||
.............................................................................................................................................
|
||||
.......^.^...^.^...^.^.^.^...^...^.^.^.^.^.^.^.^.....^.^...^.^.^...^...^.^.^...^.^.^.^.....^.^...^.^.....^...^.^.....^.^.^.^.^.^.....^.......
|
||||
.............................................................................................................................................
|
||||
......^.^.^.^.^.....^.^.^.^.^.^.......^.^.^.^.^.^...^.^...^.....^.^.^.^...^.^.^.^.^.^.^.^.^.^.^...^.....^...^.^.^.^.^.....^.^.^.^...^.^......
|
||||
.............................................................................................................................................
|
||||
.....^...^.^.^.^.^...^.^.^.^...^.^.^.^.^.^.^.^.^.^.^...^.^.^.^.^.....^.^.^.^...^.^...^.^.^.....^.^.^.^.^...^...^...^.....^.^.^...^.^.^.^.....
|
||||
.............................................................................................................................................
|
||||
....^.^.^...^.^.^.^.^.^.^.^.....^.^.....^.^.^...^.^.^.^.^.^.....^.^.^...^.^.....^.^.^...^.........^...^.^.^.^.^.^...........^.^.^.....^.^....
|
||||
.............................................................................................................................................
|
||||
...^.^.^.^...^...^.^...^.^.^.^.^...^.^.^...^.^.....^...^.^...^.^...^...^.^.^...^...^.^.^.^.^.....^.^...^.^.^...^.....^...^.....^...^.....^...
|
||||
.............................................................................................................................................
|
||||
..^.^.^...^...^...^.^...^.^.^.^.^.....^.....^.^...^.^...^.^.^.^.^...^.^.^...^.^.^.^.^.^.^...^.^...^.^.^...^.^.^.^.^...^.^.^.....^...^...^.^..
|
||||
.............................................................................................................................................
|
||||
.^...^.^.^.....^.....^...^.....^.^...^...^.......^.^.^.^.^.^.^.^...^.^...^.^.^...^.^.^.^...^.^.^...........^.^...^...^.^.^...^...^...^.^...^.
|
||||
.............................................................................................................................................
|
||||
1000
puzzles/input08.txt
Normal file
1000
puzzles/input08.txt
Normal file
File diff suppressed because it is too large
Load Diff
496
puzzles/input09.txt
Normal file
496
puzzles/input09.txt
Normal file
@@ -0,0 +1,496 @@
|
||||
97918,50201
|
||||
97918,51425
|
||||
98247,51425
|
||||
98247,52647
|
||||
98195,52647
|
||||
98195,53859
|
||||
98005,53859
|
||||
98005,55071
|
||||
97872,55071
|
||||
97872,56297
|
||||
97835,56297
|
||||
97835,57522
|
||||
97759,57522
|
||||
97759,58659
|
||||
97171,58659
|
||||
97171,59849
|
||||
96924,59849
|
||||
96924,61075
|
||||
96832,61075
|
||||
96832,62278
|
||||
96613,62278
|
||||
96613,63385
|
||||
96045,63385
|
||||
96045,64538
|
||||
95663,64538
|
||||
95663,65837
|
||||
95705,65837
|
||||
95705,66999
|
||||
95314,66999
|
||||
95314,68121
|
||||
94816,68121
|
||||
94816,69159
|
||||
94132,69159
|
||||
94132,70235
|
||||
93557,70235
|
||||
93557,71392
|
||||
93150,71392
|
||||
93150,72594
|
||||
92813,72594
|
||||
92813,73464
|
||||
91858,73464
|
||||
91858,74283
|
||||
90857,74283
|
||||
90857,75827
|
||||
91050,75827
|
||||
91050,76622
|
||||
90026,76622
|
||||
90026,77623
|
||||
89334,77623
|
||||
89334,78461
|
||||
88419,78461
|
||||
88419,79592
|
||||
87898,79592
|
||||
87898,80529
|
||||
87121,80529
|
||||
87121,81258
|
||||
86103,81258
|
||||
86103,82506
|
||||
85676,82506
|
||||
85676,82951
|
||||
84373,82951
|
||||
84373,84417
|
||||
84129,84417
|
||||
84129,84738
|
||||
82744,84738
|
||||
82744,85431
|
||||
81740,85431
|
||||
81740,86272
|
||||
80874,86272
|
||||
80874,86984
|
||||
79898,86984
|
||||
79898,87707
|
||||
78934,87707
|
||||
78934,88651
|
||||
78132,88651
|
||||
78132,89825
|
||||
77471,89825
|
||||
77471,90048
|
||||
76152,90048
|
||||
76152,91026
|
||||
75332,91026
|
||||
75332,91113
|
||||
73969,91113
|
||||
73969,92433
|
||||
73319,92433
|
||||
73319,92653
|
||||
72052,92653
|
||||
72052,92817
|
||||
70779,92817
|
||||
70779,93561
|
||||
69793,93561
|
||||
69793,94429
|
||||
68844,94429
|
||||
68844,94816
|
||||
67683,94816
|
||||
67683,94825
|
||||
66387,94825
|
||||
66387,95504
|
||||
65340,95504
|
||||
65340,96215
|
||||
64286,96215
|
||||
64286,95778
|
||||
62890,95778
|
||||
62890,96609
|
||||
61858,96609
|
||||
61858,97235
|
||||
60751,97235
|
||||
60751,97506
|
||||
59554,97506
|
||||
59554,97496
|
||||
58306,97496
|
||||
58306,97162
|
||||
57021,97162
|
||||
57021,97638
|
||||
55863,97638
|
||||
55863,98017
|
||||
54678,98017
|
||||
54678,98087
|
||||
53458,98087
|
||||
53458,98404
|
||||
52250,98404
|
||||
52250,98467
|
||||
51023,98467
|
||||
51023,97591
|
||||
49799,97591
|
||||
49799,97549
|
||||
48594,97549
|
||||
48594,97447
|
||||
47393,97447
|
||||
47393,97559
|
||||
46176,97559
|
||||
46176,97590
|
||||
44957,97590
|
||||
44957,97139
|
||||
43794,97139
|
||||
43794,97718
|
||||
42484,97718
|
||||
42484,97235
|
||||
41328,97235
|
||||
41328,97025
|
||||
40129,97025
|
||||
40129,96569
|
||||
38986,96569
|
||||
38986,96439
|
||||
37767,96439
|
||||
37767,96227
|
||||
36561,96227
|
||||
36561,95775
|
||||
35425,95775
|
||||
35425,95708
|
||||
34160,95708
|
||||
34160,94873
|
||||
33165,94873
|
||||
33165,94442
|
||||
32030,94442
|
||||
32030,93853
|
||||
30961,93853
|
||||
30961,93475
|
||||
29801,93475
|
||||
29801,93145
|
||||
28610,93145
|
||||
28610,92571
|
||||
27533,92571
|
||||
27533,91778
|
||||
26580,91778
|
||||
26580,91054
|
||||
25599,91054
|
||||
25599,90700
|
||||
24392,90700
|
||||
24392,90098
|
||||
23330,90098
|
||||
23330,89610
|
||||
22181,89610
|
||||
22181,88575
|
||||
21422,88575
|
||||
21422,87836
|
||||
20456,87836
|
||||
20456,87257
|
||||
19358,87257
|
||||
19358,86584
|
||||
18325,86584
|
||||
18325,85761
|
||||
17416,85761
|
||||
17416,84396
|
||||
17026,84396
|
||||
17026,83497
|
||||
16219,83497
|
||||
16219,82724
|
||||
15282,82724
|
||||
15282,81812
|
||||
14488,81812
|
||||
14488,81287
|
||||
13242,81287
|
||||
13242,80044
|
||||
12835,80044
|
||||
12835,79273
|
||||
11850,79273
|
||||
11850,78300
|
||||
11117,78300
|
||||
11117,77140
|
||||
10654,77140
|
||||
10654,76100
|
||||
10032,76100
|
||||
10032,75292
|
||||
9038,75292
|
||||
9038,74404
|
||||
8140,74404
|
||||
8140,73087
|
||||
7988,73087
|
||||
7988,71995
|
||||
7455,71995
|
||||
7455,71036
|
||||
6653,71036
|
||||
6653,69869
|
||||
6271,69869
|
||||
6271,68669
|
||||
5984,68669
|
||||
5984,67752
|
||||
5008,67752
|
||||
5008,66446
|
||||
5011,66446
|
||||
5011,65435
|
||||
4213,65435
|
||||
4213,64209
|
||||
4035,64209
|
||||
4035,63114
|
||||
3426,63114
|
||||
3426,61827
|
||||
3512,61827
|
||||
3512,60715
|
||||
2925,60715
|
||||
2925,59521
|
||||
2657,59521
|
||||
2657,58341
|
||||
2305,58341
|
||||
2305,57063
|
||||
2555,57063
|
||||
2555,55868
|
||||
2321,55868
|
||||
2321,54631
|
||||
2469,54631
|
||||
2469,53453
|
||||
1978,53453
|
||||
1978,52239
|
||||
1840,52239
|
||||
1840,51023
|
||||
1568,51023
|
||||
1568,50187
|
||||
94581,50187
|
||||
94581,48595
|
||||
2489,48595
|
||||
2489,47360
|
||||
1948,47360
|
||||
1948,46149
|
||||
2099,46149
|
||||
2099,44932
|
||||
2173,44932
|
||||
2173,43745
|
||||
2490,43745
|
||||
2490,42544
|
||||
2663,42544
|
||||
2663,41373
|
||||
3007,41373
|
||||
3007,40066
|
||||
2674,40066
|
||||
2674,39008
|
||||
3523,39008
|
||||
3523,37778
|
||||
3604,37778
|
||||
3604,36502
|
||||
3567,36502
|
||||
3567,35540
|
||||
4584,35540
|
||||
4584,34126
|
||||
4191,34126
|
||||
4191,33194
|
||||
5204,33194
|
||||
5204,32063
|
||||
5639,32063
|
||||
5639,30930
|
||||
6073,30930
|
||||
6073,29848
|
||||
6623,29848
|
||||
6623,28717
|
||||
7070,28717
|
||||
7070,27492
|
||||
7350,27492
|
||||
7350,26613
|
||||
8281,26613
|
||||
8281,25390
|
||||
8594,25390
|
||||
8594,24514
|
||||
9492,24514
|
||||
9492,23522
|
||||
10191,23522
|
||||
10191,22173
|
||||
10377,22173
|
||||
10377,21180
|
||||
11097,21180
|
||||
11097,20343
|
||||
12018,20343
|
||||
12018,19523
|
||||
12942,19523
|
||||
12942,18816
|
||||
13983,18816
|
||||
13983,17981
|
||||
14858,17981
|
||||
14858,16809
|
||||
15376,16809
|
||||
15376,16068
|
||||
16353,16068
|
||||
16353,15030
|
||||
17038,15030
|
||||
17038,14301
|
||||
18019,14301
|
||||
18019,13410
|
||||
18855,13410
|
||||
18855,12559
|
||||
19733,12559
|
||||
19733,12152
|
||||
20957,12152
|
||||
20957,10852
|
||||
21506,10852
|
||||
21506,10788
|
||||
22952,10788
|
||||
22952,9988
|
||||
23871,9988
|
||||
23871,8781
|
||||
24548,8781
|
||||
24548,8442
|
||||
25771,8442
|
||||
25771,7748
|
||||
26780,7748
|
||||
26780,7638
|
||||
28098,7638
|
||||
28098,6597
|
||||
28936,6597
|
||||
28936,6634
|
||||
30295,6634
|
||||
30295,5530
|
||||
31137,5530
|
||||
31137,5119
|
||||
32291,5119
|
||||
32291,5171
|
||||
33611,5171
|
||||
33611,4750
|
||||
34745,4750
|
||||
34745,4394
|
||||
35901,4394
|
||||
35901,4192
|
||||
37101,4192
|
||||
37101,3248
|
||||
38105,3248
|
||||
38105,3209
|
||||
39349,3209
|
||||
39349,2909
|
||||
40529,2909
|
||||
40529,2965
|
||||
41774,2965
|
||||
41774,2208
|
||||
42884,2208
|
||||
42884,2578
|
||||
44163,2578
|
||||
44163,2700
|
||||
45391,2700
|
||||
45391,1938
|
||||
46543,1938
|
||||
46543,2387
|
||||
47786,2387
|
||||
47786,2473
|
||||
48995,2473
|
||||
48995,2002
|
||||
50202,2002
|
||||
50202,1582
|
||||
51430,1582
|
||||
51430,1775
|
||||
52649,1775
|
||||
52649,2210
|
||||
53841,2210
|
||||
53841,2166
|
||||
55067,2166
|
||||
55067,2369
|
||||
56270,2369
|
||||
56270,2715
|
||||
57447,2715
|
||||
57447,2376
|
||||
58742,2376
|
||||
58742,3117
|
||||
59840,3117
|
||||
59840,2894
|
||||
61140,2894
|
||||
61140,3742
|
||||
62185,3742
|
||||
62185,3817
|
||||
63425,3817
|
||||
63425,3989
|
||||
64648,3989
|
||||
64648,5057
|
||||
65573,5057
|
||||
65573,4922
|
||||
66910,4922
|
||||
66910,5185
|
||||
68120,5185
|
||||
68120,5964
|
||||
69117,5964
|
||||
69117,6674
|
||||
70128,6674
|
||||
70128,6710
|
||||
71460,6710
|
||||
71460,7450
|
||||
72454,7450
|
||||
72454,8385
|
||||
73327,8385
|
||||
73327,8392
|
||||
74729,8392
|
||||
74729,9508
|
||||
75475,9508
|
||||
75475,10041
|
||||
76576,10041
|
||||
76576,10869
|
||||
77480,10869
|
||||
77480,11720
|
||||
78357,11720
|
||||
78357,12429
|
||||
79335,12429
|
||||
79335,12852
|
||||
80550,12852
|
||||
80550,13833
|
||||
81313,13833
|
||||
81313,14720
|
||||
82144,14720
|
||||
82144,15684
|
||||
82895,15684
|
||||
82895,16530
|
||||
83752,16530
|
||||
83752,17162
|
||||
84838,17162
|
||||
84838,17952
|
||||
85773,17952
|
||||
85773,18787
|
||||
86668,18787
|
||||
86668,19898
|
||||
87235,19898
|
||||
87235,20534
|
||||
88399,20534
|
||||
88399,21819
|
||||
88718,21819
|
||||
88718,22937
|
||||
89233,22937
|
||||
89233,23968
|
||||
89861,23968
|
||||
89861,24660
|
||||
91036,24660
|
||||
91036,25849
|
||||
91424,25849
|
||||
91424,26916
|
||||
92004,26916
|
||||
92004,27802
|
||||
92933,27802
|
||||
92933,28832
|
||||
93616,28832
|
||||
93616,30336
|
||||
93275,30336
|
||||
93275,31169
|
||||
94394,31169
|
||||
94394,32316
|
||||
94816,32316
|
||||
94816,33403
|
||||
95397,33403
|
||||
95397,34581
|
||||
95737,34581
|
||||
95737,35916
|
||||
95557,35916
|
||||
95557,37120
|
||||
95737,37120
|
||||
95737,38230
|
||||
96258,38230
|
||||
96258,39290
|
||||
97047,39290
|
||||
97047,40627
|
||||
96600,40627
|
||||
96600,41738
|
||||
97237,41738
|
||||
97237,42902
|
||||
97667,42902
|
||||
97667,44190
|
||||
97201,44190
|
||||
97201,45331
|
||||
97913,45331
|
||||
97913,46539
|
||||
98110,46539
|
||||
98110,47754
|
||||
98296,47754
|
||||
98296,48987
|
||||
97943,48987
|
||||
97943,50201
|
||||
172
puzzles/input10.txt
Normal file
172
puzzles/input10.txt
Normal file
@@ -0,0 +1,172 @@
|
||||
[.###.#..] (0,2,3,4,6,7) (1,2,4,5,6) (1,3,4,5,7) (0,2,4) (4,7) (0,1,4,6) (1,2,3,4,5,7) (2,4,7) {29,44,42,26,66,27,30,36}
|
||||
[###.#...] (3,4,6) (1,2,3,4,5,7) (0,1,2,4) (0,1,3,5,7) (0,1,4,5,6,7) (0,2,7) (4,6) (7) (0,6) (1,4,5,6,7) {214,221,33,36,226,204,203,217}
|
||||
[##.#.###] (0,1,7) (2,3,4,5,6,7) (0,3,4,5,6,7) (0,1,3,5,6,7) (2,7) (0,1,2,3,4,6,7) (0,1,3,4,6,7) {68,52,32,65,52,36,65,88}
|
||||
[.#.#...#..] (0,1,4,5,9) (0,2,6,7,8,9) (0,5,6,9) (2,5,6) (1,5,9) (0,1,3,4,6,7,8,9) (2) (0,1,2,3,4,6,8) (0,7,8,9) (0,1,3,5,6,7,9) (3,5,9) {68,64,220,49,46,43,59,35,36,57}
|
||||
[##.#..#] (0,2,3,4) (2,3,5) (0,1,3,6) (0,1,3,4,5) (0,1,5,6) (5) {26,16,194,197,13,205,13}
|
||||
[.##.....##] (0,1,4,7,8,9) (1,3,4,5,6,9) (2,4,9) (3,6,8) (0,2,3,4,6,7,8) (0,1,2,3,4,5,6,8) (1,2,3,4,6,7,8,9) (2,4,6,9) (0,1,5,8,9) (2,7) (4,6,8,9) (1,3,4,5,7,8,9) (1,3,4,6,7,8,9) {12,56,55,72,88,16,88,57,85,79}
|
||||
[#...#] (0,2,3,4) (2,3) (0,1,2,3) (0,1,2) {27,21,43,41,6}
|
||||
[#.###] (0,1,3) (1,2,3,4) (1,2,4) {4,29,25,14,25}
|
||||
[#....##.#.] (5,6,8) (0,2,5,6,7,9) (1,3,5,6,7,9) (1,2,7,9) (1,2,4,5,6,7,8,9) (2,8) (0,2,3,5,6,7,8,9) (0,4,5,9) (4,5,8) (4,5) (0,2,3,4,5,7,8,9) (0) (1,2,3,4,5,6,7,8) {49,233,86,233,57,297,253,271,72,271}
|
||||
[.#.##.] (0,2,4) (1) (3,4) (0,1,3,4,5) (0,1,2,5) (1,2) {42,46,35,25,35,32}
|
||||
[..#.#] (0,3) (1,2,4) (1,2) (1,2,3,4) (0,2) (1,4) (2,3,4) {15,32,19,17,21}
|
||||
[..##...] (0,1,2,5,6) (1,2,4,6) (0,1,3,5,6) (0,5) (1,3,5,6) (0,1,2,3,4,6) (5,6) (4,5) {34,37,14,35,29,64,55}
|
||||
[##..#] (0,1,2,4) (1,2,3,4) (0,2,3) {141,151,155,18,151}
|
||||
[#.#.##] (0,3) (5) (0,1,3) (0,1,2,5) (0,1,2,4,5) (1,3,5) (0,1,2,4) (1,3,4,5) {53,66,23,56,32,52}
|
||||
[###.] (0,2) (0,2,3) (2,3) (0,1) (3) {40,15,38,38}
|
||||
[.#..#] (0,2,3,4) (0,1,3) (1,4) {30,21,12,30,15}
|
||||
[####.] (0,1,4) (1,2,3) (2,3,4) (1,3) (0,3) {24,12,4,30,9}
|
||||
[..#.#.#] (4,6) (2,5) (0,2) (0,1,2,3,6) (1,2,4,5,6) (0,2,3,4,6) (0,4) {45,16,57,23,49,23,43}
|
||||
[...###] (1,2) (4,5) (0,3,4) (0,2,3,5) (0,1,2,5) {36,11,27,29,27,37}
|
||||
[##.##..###] (3,5,6,7,8,9) (0,1,2,3,5,7,9) (0,5,8) (2,4,5,8) (2,3,6,7) (0,1,2,3,6,7,8) (0,1,2,4,5,6,8) (5,6,7) {55,54,73,53,39,97,75,73,75,37}
|
||||
[..##.#] (0,1,3,5) (0) (1,2,5) (3,4) (0,1,3,4) (1,2,3,5) (3,5) (0,1,5) {67,69,19,60,37,51}
|
||||
[.#...##.##] (0,1,2,5,7,8) (1,5,6,8,9) (0,1,2,6,8) (0,8,9) (0,7) (1,9) (1,3,8) (1,5,7) (0,1,2,3,4,7,8) {39,69,24,40,20,11,6,28,62,36}
|
||||
[...###.#] (0,2,3,6) (0,1,3,4,5,6,7) (0,2,4,6) (0,1,2,3,6) (3,4,5,7) (1,3,4,6,7) {56,33,48,55,29,11,63,18}
|
||||
[.#..#] (1,2,4) (2,3) (0) (1,4) (3) (3,4) (0,1,2) {23,28,26,33,26}
|
||||
[###.#.#] (0,2,3,4,6) (0,4,5,6) (3,4,5,6) (0,2) (1,4,5,6) {39,14,23,178,208,197,208}
|
||||
[#.###.#] (1,2,4,5) (0,2,3,4) (1,2,3,5,6) (0,2) (0,1,3,6) (0,1,2,6) {151,134,151,33,11,11,134}
|
||||
[......##] (0,1,2,4,6,7) (0,1,2,4,5) (0,2,3,4,5,7) (0,1,4,5,7) (0,1,2,3,6,7) (0,1,2) (6,7) (0,1,3,6) {91,80,63,32,60,42,50,65}
|
||||
[..##.#.##] (0,2,5,7) (1,2,3,6,8) (0,1,4,6,7) (5,7,8) (0,1,3,4,6,7,8) (0,5) (3,5,7) (1,3,4,5,6) (2,3,4,8) (0,1,4,5,7) (0,1,3,5,6,8) {67,79,51,89,68,93,75,87,72}
|
||||
[##..] (2) (0,3) (0,1,3) (0,1) {19,7,12,12}
|
||||
[.#.#.] (0,1,4) (1,3) (0,2,3) (2,3,4) {29,25,205,214,208}
|
||||
[###.#.##.] (0,1,2,5,6,7,8) (2,4,5,6) (1,3,4,5,6) (1,4,5,7,8) (0,2,3,5,6,7,8) (0,2,3,4,6) (0,3,4,8) (7) (0,2,5) {71,35,55,65,65,78,52,52,57}
|
||||
[.....##...] (0,1,2,3,4,5,6,7) (9) (1,4,5,6,7,8,9) (0,1,3,4,8,9) (0,2,3,6,8) (0,2) (5,6,9) (1,3,4,6,8,9) (1,3,4,5,6,8,9) (0,1,2,3,5,6,8,9) (1,2,4,5,6,7,8,9) (0,5,8) (3,5,6,8) {48,77,30,85,62,82,99,11,99,107}
|
||||
[.###..##.#] (1,2,3,4,5,6,8,9) (8,9) (0,1,2,3,5,8,9) (1,2,3,4,9) (0,1,3,4,5,7,8,9) (3,5,6,9) (1,2,3,5,6,7,9) (0,2,3,4,6,7,8,9) (0,2,3,6) (0,1,2,5,6) (1,3,4,5,7,8) (0,1,3,6,8,9) {46,82,72,101,68,70,60,45,62,95}
|
||||
[##.#...] (3,4,5) (0,3,4,5) (0,1,2,5,6) (0,2) (2,3,4,6) (0,1,4,5) (1,2,5,6) (0,1,3) (0,3,4,5,6) {74,33,19,53,45,43,16}
|
||||
[.....##.##] (7,9) (0,2,3,4,5,6,7,8) (1,3,4,5,6,7,8,9) (0,1,4,8) (2,6) (0,3,4,5,8) (3,4,5,7,8) (1,2,3,5,6,7,8) (0,3,4,6,7,8) (0,8) (1,2,3,4,6) {31,52,39,48,64,34,53,33,55,15}
|
||||
[.##..####.] (0,3,4,6,9) (0,1,2,3,5,6,7,8,9) (3,4) (0,3,7,8,9) (0,1,2,5,6,7,9) (1,3,4,5,6,8,9) (4,7) (1,3,6,8,9) (0,1,2,3,4,5,8) (6,7) {61,32,27,62,56,32,35,41,36,52}
|
||||
[#.........] (1,3,4,7) (1,4,5,7,8) (0,1,2,3,5,7,9) (4,5) (2,3,9) (0,1,2,3,6,7,8,9) (3,6,9) (0,1,4,6,7,8) (0,4,9) (1,2,3,6) (5,7,8,9) (6) {36,70,32,60,49,33,64,58,35,45}
|
||||
[#..##.] (0,1,4) (1,2,4) (0,1,2,3) (1,5) {13,42,20,0,33,9}
|
||||
[###...] (0,1,2) (1,2,4,5) (2,3,5) (1,3,5) (1) (1,2,3) {199,238,232,27,12,38}
|
||||
[.#..#...#.] (1,8,9) (2,3) (1,2,4,6,7) (0,1,2,3,4,7,8) (1,2,3,5,6,7,8,9) (1,2,7) (1,2,7,9) (2,3,4,5,7,8,9) (1,3,5,6,7,9) (0,2,3,5,7,8,9) (0,2,3,4,6,8) {24,64,85,71,35,52,39,83,58,76}
|
||||
[..#..#....] (5,7) (1,3,4,5,6,8) (0,2,3,4,5,6,7,9) (0,3,8) (1,2,3,4,6,8) (1,6,9) (1,2,3,4,7,8,9) (4,7) {18,42,20,51,52,30,24,53,50,29}
|
||||
[#.####] (1,2) (0,1,4) (3,5) (1,4,5) {14,38,19,16,19,21}
|
||||
[..#..#.#.#] (4,6) (1,2,3,5,6,8,9) (0) (0,1,3,4,5,6,8,9) (0,1,3,4,6,7,8) (0,1,5,7,8) (0,1,4,5,8) (3,4,7,8) (1,9) (0,1,2,3,5,8,9) (5,6,9) (4,6,8,9) (0,4,6,7) {48,63,17,57,51,161,167,30,61,173}
|
||||
[.#..] (0,1) (0,2) (0,1,2) (1,3) {134,125,19,10}
|
||||
[#..#...##] (0,1,2,4,5,6,7) (3,4,5,6,8) (0,3,4,5,6) (0,1,2,3,4,5,6,8) (1,4,5,8) (1,2,6,8) (2,8) (0,4,7,8) (0,2,5,6,7) (0,1,3,4,7) {239,250,225,234,253,237,241,31,232}
|
||||
[..###] (1,2,3,4) (0,1,2) (0,4) (0,1,4) (2,3,4) {35,21,29,19,44}
|
||||
[#####] (1,2) (0,1,3,4) (0,3,4) (2) (0,1,4) (3,4) {29,27,12,34,41}
|
||||
[#.#.##.] (1,3,5,6) (0,2,3) (3,4,6) (0,2,4,5,6) (0,4) (2) (0,1,4,5,6) (2,3,4,5) (1,2,4,5,6) {43,21,73,41,62,61,42}
|
||||
[##.###.] (0,1,2,5,6) (0,1,3,4,5) (0,1,3,4,6) (0,1,3,4,5,6) (0,2,3,4,5) (2,3,4) (3,4,5) (0,1,2) {187,167,59,174,174,180,143}
|
||||
[..###] (0,2,3) (0,1,2,3,4) (1,2,3) (1,2) {178,17,195,184,0}
|
||||
[#.#.####] (0,1,3,4,5) (1,2,4,5,6,7) (7) (0,2,4,5,6,7) (0,2,3,5,6,7) (2,4,5,6,7) (2,3) (1,2,3,5,6,7) {38,33,50,47,31,59,45,52}
|
||||
[..#..#..#] (6,8) (1,2,5,6) (0,1,2,3,8) (2,4) (0,1,2,3,5,7,8) (0,2,3,6,7) (1,2,3,4,5,6,8) (0,1,2,3,4,5,6) (0,2,4) (0,1,2,4,6,7,8) (2,7) {67,69,126,63,55,49,64,35,34}
|
||||
[.####.] (2,4,5) (1,2,3,4) (3) (0,2,3,5) (0,2,5) (0,3) (1,5) (0,3,4,5) {36,33,32,53,30,52}
|
||||
[.#...##..] (1,2,3,4,7,8) (5,7) (0,1,3,4,8) (0,1,4) (1,2,3,5,6,8) (0,3,4,6,7,8) (0,2,4,5,7,8) (1,3,4,5,6,7,8) {47,39,35,53,61,58,43,67,70}
|
||||
[##.#..#...] (0,1,2,4,9) (0,1,4,5,7) (0,1,2,4,5,6,7,8) (1,4,5,6,7,8,9) (0,1,3,6,8) (0,5,7) (2,5,9) (6,9) (0,3,4,6,8,9) (3,5,6,8,9) (2,3,9) {79,68,128,135,61,61,67,48,54,165}
|
||||
[#...] (0,2) (1,3) (0,1) (1,2,3) (1) {17,26,20,18}
|
||||
[.#.####.] (2,6) (0,2,5,6,7) (0,2,3,4,7) (1,3,6) (2,3,4,5) (1,2,3,4,5,7) (3,4,5,6,7) {21,32,60,55,38,55,63,48}
|
||||
[#..###..#] (2,3,5,6) (0,3,6,7) (0,1,4) (0,3,4,5,6) (0,2,4,5,6,7,8) (0,1,4,6,7,8) (2,3,6,7) {58,32,44,52,42,29,80,60,28}
|
||||
[..#.##..##] (0,4) (1,2,3,4,5,8,9) (0,9) (0,5,7) (1,5,7,8) (0,2,4,5,6,8,9) (5,6,8) (0,3,7) (1,2,6) (0,1,4,6,7,8,9) {45,24,17,12,35,31,38,31,46,36}
|
||||
[#..#.#.] (2,4,6) (0,1,3,4) (1,3,5) (0,1,2,4,6) (0,3,4,5) (0,1,3,5,6) (0,1,3,6) (0,2,4) (2,3,4,6) {51,44,43,50,44,33,49}
|
||||
[#..#] (1) (1,2,3) (1,3) (3) (2) (0,3) {16,13,7,48}
|
||||
[##..#..] (0,4) (0,3,5,6) (1,2,5,6) (0,2,3,4,5,6) (0,3,4) {33,12,16,26,31,18,18}
|
||||
[##..#.##] (1,4) (0,1,2,3,4,5) (1,6) (0,2,6) (0,6) (0,2,3,4,5,7) (0,2,4,6,7) (1,2,3,4,6,7) (3,4) {64,26,55,37,65,25,46,38}
|
||||
[#..#.] (0,1,4) (0,2,3) (2) {16,7,16,9,7}
|
||||
[..##.#] (1,3,4) (1) (0,5) (2,3,4,5) (2,3,5) {18,30,11,29,25,29}
|
||||
[#....#] (1,3,4,5) (0,3) (3) (1,3,4) (0,1,2,4) (2,5) (1,2,3,4,5) {17,49,36,54,49,34}
|
||||
[#....#.] (4,5) (1,3,4,5,6) (0,1,2,4,5,6) (3) (0,1,2,3,5) (1,4) (3,5) (0,1,3,6) {20,43,7,48,37,30,34}
|
||||
[...##] (0,1,2) (0,1,4) (0,1,2,4) (0,1,2,3) {159,159,147,130,18}
|
||||
[..##] (0,1,2) (0,2,3) (2,3) {19,12,20,8}
|
||||
[..#.#] (0,1,2,3,4) (1,2,3) (0,2,3) (1,2) {25,33,49,41,9}
|
||||
[.##.] (1,2,3) (0,1,3) (0,2,3) {14,7,19,20}
|
||||
[#..#] (1,2,3) (2) (0) (0,1,2) {30,21,154,4}
|
||||
[#.##.] (1,2,3) (0,2,3) (2) (2,4) (1,3,4) (0,1) (1,3) {20,44,45,64,18}
|
||||
[#.#.#.] (0,5) (0,2,4) (1) (3,5) (0,1,2,3,5) {38,36,29,21,10,30}
|
||||
[#..#.....] (0,3) (0,1,2,4) (3,4,5,6) (0,1,3,5,7,8) (1,4,7,8) (0,1,2,4,5,6) (2,4,6) (1,2,3,4,5,6) {34,55,52,36,75,39,47,17,17}
|
||||
[.#.#] (1,3) (0,2) {4,1,4,1}
|
||||
[#.#.#####] (0,1,2,3) (2,4,8) (2,6,7,8) (1,4,5,7) (5,8) (4,5,6,7,8) (8) (3,8) (2,4,6,7) (1,4,5) {20,27,40,20,25,38,27,32,64}
|
||||
[###.##.#] (0,1,3,4,6) (0,5,6) (1,2,3,5,6,7) (3,4,5,7) (1,2,3,4,5,6,7) (1,2,3,4,6) (1,2,3,4,6,7) (0,1,3,5,6) (0,3,4,5,7) (3,4,7) {24,234,225,267,251,51,239,64}
|
||||
[....###] (2,3,4,6) (1,2,3,4,5) (1,3,4,5) (0,1,4,6) (1,2,4,6) (0,1,2,4) (0,1,2,5,6) {25,48,46,31,43,36,39}
|
||||
[##..##...] (0,2,3,4,5,6,7,8) (1,4) (0,2,7) (3,5,6) (0,1,3,5,6,7,8) (2,5,7) (1,8) (1,2,5,6,7,8) (1,2,3,4,5,6,7) (3) (7) {16,55,47,46,28,61,42,72,33}
|
||||
[#..##.] (1,2,3,4,5) (0,1,2,5) (1,2,4,5) (2,3,4) (1) {9,50,42,14,33,33}
|
||||
[..#.#.##..] (1,3,5,9) (6,7,8) (0,1,2,3,4,5,6) (3,7,8,9) (6,7) (3,4,6,7,9) (1,2,3,4,5) (3) (4,5,7,9) (1,3,8) (0,2,3,6,8,9) (1,2,5,7) {4,30,18,62,32,42,40,78,40,57}
|
||||
[.##.###] (0,1,2,4,5,6) (3,4,5) (0,3,6) (2,3,4,5,6) (0,3,5,6) (1,4,5) {26,18,21,51,49,62,41}
|
||||
[.#.#] (1,3) (0,1,3) (1,2) {9,22,6,16}
|
||||
[......#] (0,2,4,5,6) (1,2,4,5,6) (2,3,4,5,6) (3,4) (0,2,3,4) (0,2,3,5) (1,3,4,6) {33,21,51,57,63,37,41}
|
||||
[###.] (0,1,2) (1,3) {19,36,19,17}
|
||||
[...##] (3,4) (1) (0,2,3,4) (1,2) {0,10,7,15,15}
|
||||
[##...####] (0,1,3,4,5,7) (0,2,4,8) (6,7) (0,3,4,5,6,7,8) (0,2,3,4,6,7) (1,2,3,4,5,8) (0,1,2,3,6,7,8) {152,133,154,157,38,16,166,167,142}
|
||||
[####] (0,1,2,3) (0,2) {25,7,25,7}
|
||||
[..#..#.##.] (0,1,2,3,5,7,8,9) (0,1,2,4,5,6,7,8,9) (0,1,2,3,5,7,9) (3,4,6,7) (1,2,5,7,9) (1,2,5,6,7,8,9) (0,2,4,5,7,8) (1,2,4,5,6) {37,66,77,24,30,77,31,60,33,49}
|
||||
[.#.#..] (0) (2,4) (1,3,4) (0,3,4,5) (1,4) (2,3,4) (0,1,2,5) {153,36,23,23,53,6}
|
||||
[.####.#.#] (0,1,2,4,6,7) (0,4,5,6,7,8) (0,1,4,5,6,7,8) (0,6,8) (0,4,6,7) (1,2,3,4,8) (3,4,5,8) (0,1,3,4,7,8) (1,7,8) (1,8) {71,72,31,37,82,30,57,79,89}
|
||||
[##.#.#...#] (1,2,5,9) (0,1,2,4,5,6,7,8) (0,2,3,4,5,7,8) (1,2,3) (0,2,3,4,6,8) (7,8) (0,2,5,6) (0,1,2,3,4,5,6,7) {48,27,65,47,37,40,29,195,200,0}
|
||||
[#.##..##.] (0,1,2,5,6,8) (1,2,3,5,6,8) (0,1,3,4,5,7,8) (3,6,8) (1,4,5,6,8) (1,3,5,8) (1,6) (0,1,2,4,5,6,7,8) (1,2,5,6,7,8) {26,76,44,42,22,56,90,23,76}
|
||||
[.#.##..#] (0,1,2,3,4,5,6) (1,2,3,4,6,7) (0,1,2,3,4,5) (0,2,5) (1,2,7) (0,1,3,4,5,6) {43,69,51,49,49,43,41,26}
|
||||
[##...#.] (3,4) (0,1,2,6) (0,1,5) (1,2,3,5,6) (2,3,4,5,6) {170,184,27,29,15,181,27}
|
||||
[#.##] (0,1) (0,1,3) (1,2) (2,3) {37,43,19,30}
|
||||
[#.#.#.#.#.] (0,1,2,3,5,6,8,9) (1,4,6) (2,3,5,6,8) (5,7,9) (0,1,2,4,6,8,9) (6) (2,4,6,9) (0,1,2,3,4,7,9) (0,3,4,8) (4,7) (0,1,2,3,4,6,8,9) (0,4) (0,1,2,4,5,8,9) {95,75,106,66,112,74,104,28,92,101}
|
||||
[.###.] (0) (0,2,3) (1,4) (1,3,4) (1,2,3,4) (0,3,4) {38,28,39,55,42}
|
||||
[####..] (1,2,3) (0,3,5) (0,1,4) (0,3,4,5) (2,3) {30,23,40,67,22,27}
|
||||
[.#..#.....] (0,2) (0,1,2,4,5,6,9) (0,2,3,6) (3,6,7) (0,1,2,3,4,5,6,8,9) (0,2,3,5,6,8,9) (1,9) (0,1,2,3,4,5,8,9) (1,3,4,5,6,8,9) (4,6) {77,42,77,59,47,38,87,16,23,48}
|
||||
[#####] (0,1,3) (0,1,2,3) (0,1,2) (0,2,4) (1,2,3) {49,153,161,138,19}
|
||||
[...#.] (1,2) (2,3,4) (0,2,3,4) (0,1,3,4) (1,2,4) (0,3,4) {30,35,44,46,62}
|
||||
[.###.##.#] (3,5) (6,7) (0,6) (2,3,5,6,7) (0,2,3,4,5,6,7,8) (4,5,6,7) (2,7,8) (1,3,6,8) (2,4,5,6,7,8) {25,3,56,48,34,61,76,76,44}
|
||||
[#..###] (2,4,5) (1,4,5) (0,3,5) (1,3) (0,2,3) (0,4,5) (0,1,2,3) {40,21,25,43,16,33}
|
||||
[.#..#.] (1,4,5) (0,1,4) (2) (1,4) (1,3) (0,2,4,5) {13,35,11,11,32,23}
|
||||
[...#] (0,2) (1,3) (0,2,3) {16,6,16,18}
|
||||
[####.##.#] (0,1,3,6,7,8) (1,2,3,5,7) (0,4,6) (0,1,2,3,4,6) (3,5,7,8) (0,1,2,4,6,8) (6,8) (5,7) (1,3,5,7,8) (0,2,3,4,5,6,7) (0,2,3,4,5,7) {71,44,49,48,58,48,71,61,41}
|
||||
[#.##..] (1,2,3,5) (0,1,4,5) (0,5) (0,3,5) (0,2,3) (3,4) {31,21,10,12,21,25}
|
||||
[...#.#..] (4,7) (4,6,7) (3,5) (0,4,5,6,7) (1,2,4,5,7) (0,3,4,6) (0,2,5) (0,3,5,6) (1,4,5) (0,1,4,5,7) {50,39,28,43,64,89,35,40}
|
||||
[..####.#] (1,2,3) (0,1,2,5) (0,1,5,6,7) (0,1,2,7) (4,7) (0,1,3,4,7) {57,57,23,20,30,18,14,63}
|
||||
[.#.###.] (1,3,4,5) (0,1,2,4,6) (0,3,5) (2,3,4,6) (0,2,4) {207,19,200,30,219,28,2}
|
||||
[#.###] (1,4) (0,2,3,4) (0,3) (0,1,2) (1,3,4) (1,2) (1,3) {39,51,35,43,41}
|
||||
[#.##] (2) (1,3) (0,3) {11,11,1,22}
|
||||
[..##] (0,2,3) (1,2) (1,3) (2,3) {4,21,20,39}
|
||||
[#.#.#.] (1,2,4) (0,1,3,5) (0,1) (1,3,5) (0,4,5) (0,2,5) {46,67,19,32,20,41}
|
||||
[#..#.#.#.] (5,7) (2,4,5,7) (1,2,3) (0,5,6) (2,4,7,8) (1,3,4,8) (0,1,3) (0,1,2,4,5,6,7) (0,2,4,6,8) (0,6,8) {72,60,71,47,78,69,58,67,63}
|
||||
[..#.#..#] (2,7) (4) (1,4) (0,2,3) (3,4,6) (6) (5) (3,4,5,6,7) (0,4,6) (2,4,7) {15,4,8,28,53,29,54,21}
|
||||
[...#] (2) (2,3) (1,3) (0,2) (0) (0,1) {22,25,31,26}
|
||||
[#.#..##..] (0,1,3,4,5,6,8) (0,1,3,4,5,6,7,8) (1,2,6,8) (2,3,5,6,7) (0,1,3,4,7,8) (0,2,6) (2,3,4,5,7) (0,2,3,4,5,6,7,8) (0,2,5,6) {68,43,42,68,62,58,66,54,57}
|
||||
[#.###] (1,2,4) (0,2,3) (2,4) (0,3) (2,3,4) {22,15,35,29,29}
|
||||
[..###...] (1,7) (0,2) (0,1,2,3,6) (0,1,2,3,4,5,7) (1,2,4,5,6,7) (5,7) {38,22,39,18,12,16,8,19}
|
||||
[..#...#] (0,3,4,5,6) (0,1,3,4,5) (0,2,3,5) (1,2) (0,1,2,3,6) (2,4) {30,18,24,30,18,16,25}
|
||||
[#.##] (1,3) (0,1) (0,2) (2,3) (0,3) (0) {44,11,20,27}
|
||||
[..##.##] (1,4,5,6) (2,3,4,6) (0,1,3,4,5) (0,4,5,6) (0,1,2,3,4) (0,3,4,6) (0,1,2,5,6) (0,2,4,5,6) {47,33,24,39,63,37,59}
|
||||
[#####....] (5) (2,4,5,6) (0,1,2,8) (0,1,8) (1,6,7) (0,2,5,6,7,8) (0,1,2,3,4) (1,2,3,4,5,7) (0,5,7) (1,3,6,7) (0,1,3,4,5,6,7) {89,223,59,176,52,70,170,201,42}
|
||||
[.##.#] (0,2,3) (0,1,3,4) (0,1,2,3) {40,32,27,40,13}
|
||||
[..###.] (1,2) (0,1,5) (0,2,3,4) (0,3,4,5) {22,12,13,15,15,14}
|
||||
[#####.] (1,3,5) (2,3,4) (1,2,3) (1,3,4,5) (0,1,3) (0,3,4) (0,4) {205,56,39,94,228,20}
|
||||
[.##...##..] (0,1,3,5,7,9) (1,6,8,9) (0,1,2,3,4,5,6,7,8) (0,4) (0,2,8,9) (0,6) (1,2,3,7) (0,1,4,5,6,7,8,9) (1,2,5,6,7,8,9) (2,3,4,5,7) {101,86,80,62,74,80,76,91,81,75}
|
||||
[###.#.#.] (0,1,2,4,5,6,7) (1,2,5,7) (0,1,2,6) (0,1,2,4,5,7) (2,4,5) (0,4,5,7) (0,1,3,4,5,6,7) {204,212,214,6,37,51,189,43}
|
||||
[####.##] (1,2,4,6) (1,2,3,5) (0,2,3,4) (0,1,5,6) (2,3) {19,33,29,16,19,20,26}
|
||||
[##.#####..] (0,1,2,3,4,5,6,8) (1,3,6) (0,1,2,3,5,6,7,8,9) (3,5,6,8) (0,1,3,5,6,8,9) (0,2,3,6,7,8,9) (0,1,2,3,4,5,7,8,9) (2,4,6,7,8) {21,157,35,172,31,36,189,27,56,13}
|
||||
[####..#] (0,2,3) (0,2,5) (3,4) (0,1,2,3,5) (1,3,5,6) (2,4,5,6) (1,3,4,5,6) {14,30,15,49,28,33,20}
|
||||
[..##.#..] (0,1,2,5,7) (0,1,3,6) (2,5) (2,3,5) (2,4,7) (0,7) (1,6) {14,156,40,4,18,22,155,31}
|
||||
[#.....] (1,4,5) (1,4) (2,3,4,5) (4) (0,1) (0) (0,2,3,4) {32,47,15,15,58,19}
|
||||
[#....#.##.] (0,1,2,3,4,5,7,9) (1,2,3,4,5,6,8,9) (0,1,3,4,5,6,8,9) (0,6) (0,2,3,4,5,6,7,8) (1,2,3,4,5,7,8) (1,7,9) (1,7) (0,1,6) (4,5,7) (4,7) (5) {31,64,39,56,83,86,40,74,55,39}
|
||||
[...##.##] (1,2,4,5,6,7) (2,3,4,7) (1,4,5,6,7) (0,3,5,7) (1,3,4,6) (2,4) (1,7) (3,5,6) (1,3,4,5,7) {5,77,54,62,108,64,57,82}
|
||||
[#####..#.#] (0,2,3,4,5,6,7,8,9) (1,2,3,5,9) (1,9) (6,9) (1,2,3,4,5,7,8,9) (0,1,6,9) (0,1,3,4,5,6,7) (0,1,2,3,5,6,9) (2,5,8,9) (4,5) (0,2,4,5,6,7,8,9) (7) {27,54,38,43,25,52,42,39,15,65}
|
||||
[#...###] (1,2,3,6) (4,5) (0,4,5,6) (0,1,6) (1,3,5,6) (0,1,2,3) (0,6) (0,1,2,3,5) (0,2,3,5,6) {100,79,75,79,22,64,89}
|
||||
[#.#.....] (0,1,4,5,6,7) (2,3,4,5,6,7) (4,5,6) (1,2,3,6) (0,1,5,6,7) (1,3,4,5,6) (0,3,5,6,7) (2,3,5,6,7) (0,2,3,7) (0,2,3,4,7) {44,37,41,44,53,78,83,69}
|
||||
[#.##..#.#] (0,1,3) (5,8) (1,2,4,5) (0,6,7) (1,5,7) (0,1,7,8) (7,8) (0,2,5,6) (1,7) (1,2,4,5,7) (0,1,2,3,5,6,7) {60,59,41,21,14,46,32,65,31}
|
||||
[#..##] (0) (1,3,4) (0,3) (2,4) (0,2) {26,15,24,20,27}
|
||||
[.##.#.#.] (0,2,4,7) (1,2,3,4,5,7) (0,1,3,4,5,6) (3,5,6) (0,1,2,3,7) (0,1,3,5,7) (1,2,3,6) (1,7) {38,139,139,143,129,121,34,128}
|
||||
[#.#.##..#.] (0,2,3,5) (4,8,9) (1,3,4,5,6,7,8,9) (1,2,3,5) (0,2,5,6,7) (4,8) (3,4,5,6,7,8) (0,3,9) (1,2,3,5,6,7) {29,20,42,53,45,61,35,35,45,16}
|
||||
[#.####.#.#] (0,1,2,4,7) (0,1,2,4,6,7,8) (0,3,5) (0,1,2,3,7) (0,1,2,3,5,6,7,9) (2,4) (2,8) (1,2,7,8) (0,3,7) (1,5,7) (1,3,6,7,8,9) {60,64,75,44,45,25,39,67,34,23}
|
||||
[###..#..#] (0,1,2,5,8) (0,1,4,5,6,7,8) (0,1,2,3,6,7,8) (0,1,3,4,5,7,8) (5,7,8) (1,2,4,8) (4,6) (0,6,7) {61,58,28,30,58,46,65,75,73}
|
||||
[#.....] (0,2,5) (1,3) (2,3,4,5) (1,2) (0,1,5) (0,1,2,4) (0) (1,2,4,5) {195,178,197,20,171,62}
|
||||
[##..] (0,1,3) (0,3) (1,2,3) (0,2) (2) (1,3) {27,27,35,41}
|
||||
[#####.] (0,4) (1,2,4) (0,1,5) (3,4) {26,33,15,17,40,18}
|
||||
[.##..#.#.] (4,6,7,8) (2,3,7) (0,4) (1,5,8) (1,4,5) (0,2,3,4,5,6,7,8) (0,2,3,4,6,7,8) (1,3,4,5,6,7,8) {34,41,25,44,90,60,63,63,67}
|
||||
[#...] (0,2,3) (0,3) (1,2) (0,1,2) (0,2) {43,32,51,11}
|
||||
[.#.#.#..#] (0,1,5,8) (2,4,6) (0,2,4,5,7,8) (1,2,7) (4,6,8) (0,1,5,6,7) (0,3,6,7,8) {61,48,177,18,169,43,186,58,59}
|
||||
[..###] (0,1,2) (0,1,4) (1,2,3) (0,3,4) (2,3,4) (0,2,3) {29,204,216,217,9}
|
||||
[.#.#.#..#.] (2,3,4,5,8,9) (0,1,3,5,7) (1,2,4,6,7,8) (1,2,3,4,5,6,8) (0,1,2,3,4,6,8,9) (1,3,5,6,7,8,9) (1,3,6,7) (0,1,5,6,7,9) (1,2,3,4,5,6,7,8) {22,190,45,193,45,65,185,170,64,50}
|
||||
[#.##.] (0,1,3,4) (0,1,2) (1,2,3) (0,2,3) (3) (1,3) (2) {41,42,32,38,15}
|
||||
[..#.##] (2,3,5) (0,1,5) (0,3,4,5) (1,2,4,5) (0,1,4,5) (5) (1,3,4) (1,4) {39,69,22,17,54,61}
|
||||
[##..#.##] (1,2,3,5,6,7) (3,5,6,7) (0,1,2,3,4,6,7) (1,6,7) (0,2,4,7) (3,4) (1,3,4) (1,3,5,7) (0,1,2,3,4,6) {25,64,42,83,45,42,61,60}
|
||||
[.##....#] (0,2,5,7) (0,1,2,3,5) (0,2,3,4,5) (0,1,4,5,6) (0,2,4,5,6) (3,6,7) (1,4,5,6,7) (0,2,3,4,5,7) {64,14,53,29,46,65,41,44}
|
||||
[#......] (0,1,3,4,5,6) (1,4,6) (0,1,6) (0,1) (1,2,3,5) (1,3,4,5) (0,1,2,3,6) (0,1,3,4,5) {174,188,6,150,153,144,159}
|
||||
[.##.##] (0,1,2,3,5) (0,5) (1,4,5) (0,2,5) (0,2,3,4) (1,3,5) {42,32,35,22,16,55}
|
||||
[#.#....#] (0,2,7) (3,6,7) (2,4,6,7) (0,1,4,5,6) (1,2,4,5,7) (0,1,2,3,4) (1,5,7) {24,27,52,30,44,17,41,63}
|
||||
[.##.##.#.] (0,1,2,3,4,7,8) (0,3,5,8) (1,2,4) (0,2,3,5,7,8) (0,1,2,4,5,6,7,8) (0,2,3) (1,3,4,5,6,7) {86,52,81,72,52,52,18,51,69}
|
||||
[#.#.###.] (4,6) (1,2,3,4,5) (0,1,2,3,4,5,6) (0) (0,1,4,6) (3) (1,6) (1,5) (0,4,7) (0,2,3) {52,30,14,29,35,28,16,18}
|
||||
[#.##] (1,3) (0,2,3) {8,9,8,17}
|
||||
[#...##..#.] (0,1,2,4,6,8,9) (2,5,6,8,9) (1,3,8) (0,1,2,3,4,6,8,9) (0,4,5,8,9) (0,8) (0,1) (1,2,3,4,5,6,8,9) (4,5,7,9) {51,67,69,48,71,52,69,8,99,86}
|
||||
[.####.##] (1,2,4,6) (1,2,3,7) (0,1,3,4,5,6,7) (0,2,3,4,6,7) (1,4,5,7) (0,2,3,4,5,7) (0,1,2,3,5) (0,2,3,5,6) (0,4) {70,55,72,63,71,45,60,45}
|
||||
[...#] (1) (2) (0,1) (0,1,3) (1,3) {34,45,6,27}
|
||||
[.#.####] (3,4,5) (0,1,4,5) (0,1,2,4,6) (2,5) (1,2,3,4,6) (0,1,3,6) {37,38,16,32,35,23,31}
|
||||
[...#.#] (1,5) (0,1) (4) (0,1,4) (0,3,4) (0,1,2) (0,2,3,4) {44,43,25,20,25,19}
|
||||
[#####.] (0,2,3,4) (0,1,3) (1,2,3,4,5) (0,1,2) (0,1,2,4,5) {159,24,154,146,144,7}
|
||||
[.#..#] (1,2,3,4) (0,2,3,4) (1,2) (3,4) (0,4) (0,1) {27,23,36,29,31}
|
||||
643
puzzles/input11.txt
Normal file
643
puzzles/input11.txt
Normal file
@@ -0,0 +1,643 @@
|
||||
ufk: out
|
||||
kgy: srg try
|
||||
fhi: mxe
|
||||
ywm: tsx jqk tco
|
||||
hjp: pxg fkj ode
|
||||
tzd: orq joq smr
|
||||
gmu: qfj
|
||||
kow: tsx jqk
|
||||
lga: ldk kcm eyu
|
||||
trj: nnb gek
|
||||
uqc: fdh rdj
|
||||
opa: uwc iet cst hnj ybf
|
||||
xtf: yso rzi tew
|
||||
exk: wgb jyz zri igi
|
||||
ice: rhu
|
||||
fpv: wcy wnm
|
||||
wuh: iet uwc ybf hnj
|
||||
hon: vbl rnk met ihp
|
||||
jvj: gqx
|
||||
lgn: out
|
||||
zzi: aef ecv
|
||||
sce: ixo unv
|
||||
uxr: iut
|
||||
nss: qbk ncd
|
||||
qjk: out
|
||||
vjv: you rhu jny
|
||||
fwg: tco
|
||||
ffk: rpq txp vug hfz
|
||||
djh: fdh
|
||||
ekp: sau gbi
|
||||
amf: ecv kjy
|
||||
ciy: lgn fzm
|
||||
uiv: lpi xgf
|
||||
ihp: cui oul tsz
|
||||
qxa: jny rhu you
|
||||
xhl: vyp yoy
|
||||
tdm: fcw gzu
|
||||
avz: omy
|
||||
qfj: kuh anb gxw ulx
|
||||
rlu: ldg jee qpe riq
|
||||
adu: lvz eda uiv
|
||||
ykx: yfk
|
||||
htw: kgs rpq vug hfz
|
||||
qqf: jyz igi sdo
|
||||
nkj: out
|
||||
cxl: zhi okh
|
||||
cui: wrc wnm
|
||||
wrg: kgs txp hfz
|
||||
upv: nnb
|
||||
naw: zlb pav erz zxj oam
|
||||
vug: fdj
|
||||
yol: fek dvn ywj zxd osu
|
||||
xgf: ucd
|
||||
wnk: jny
|
||||
gfz: ikw qjy
|
||||
clh: osz
|
||||
jbw: swf czw
|
||||
pmi: ybs tkt cld
|
||||
qqr: zme bol
|
||||
yqo: tfg
|
||||
qrz: iet uwc ybf hnj
|
||||
eda: kek xgf
|
||||
yfm: tzd szb
|
||||
enl: jny
|
||||
efg: ety dro onk
|
||||
ipq: cwu rpf eru gmo
|
||||
pgw: ekp hza mog rqt
|
||||
gar: dds ihv
|
||||
clx: lvd mir ezh ugd rjt
|
||||
kek: ltl xph
|
||||
pob: jet woy
|
||||
vpy: fox rvu
|
||||
ddd: kvn fmj uxr
|
||||
pwe: ccy cys
|
||||
hzl: wcy wrc
|
||||
tfl: zxd fek ywj dvn
|
||||
urb: tgo
|
||||
fzn: uah jyp zvf
|
||||
wzs: ksm cka
|
||||
pbi: pxq fec dat
|
||||
gzl: fdh
|
||||
vbl: cui tcg fhi
|
||||
yba: xuf exk
|
||||
beo: qyj rhp jiq gfz wcx
|
||||
xee: upv mxh trj
|
||||
mfj: bvq uno daq qth wgz
|
||||
zmk: awn ala
|
||||
ldk: out
|
||||
wvv: pav syo hon clb vhq eji oio lav sdy zlb yby quj kgy
|
||||
rjt: oaf ttk apr
|
||||
efw: kjy aef ecv
|
||||
lmp: jny
|
||||
blv: juh udg
|
||||
gnn: fiw teb
|
||||
cil: mmb wxs ymh
|
||||
pfg: rvu utq
|
||||
tjq: auf
|
||||
dat: vgr ggt uco
|
||||
jnv: htw ozg
|
||||
fui: qhj
|
||||
ghw: tfg
|
||||
hza: sau jdc
|
||||
arp: okh
|
||||
uck: hzl
|
||||
hkh: fev muf ddd hgt
|
||||
svr: zae jwu wvv naw ypl
|
||||
fvc: you rhu
|
||||
ggp: fdj
|
||||
yby: xcy
|
||||
vvw: myu agv hnx
|
||||
jkl: ymh
|
||||
fiw: see
|
||||
edz: iet uwc ybf
|
||||
kym: tvq
|
||||
nmk: tdm kkc
|
||||
raf: bkp hhm rjh ydz
|
||||
xru: ych
|
||||
qwn: uwc ybf
|
||||
jnt: out
|
||||
qjq: qxa
|
||||
bon: icp rah ipt
|
||||
mxh: nnb
|
||||
ohd: tlc
|
||||
daw: ice
|
||||
sen: vpy
|
||||
aqf: jny you
|
||||
lav: bbl kbm nze
|
||||
tgo: you rhu
|
||||
aum: fvc nqq fne
|
||||
mtn: nsy uho uou yqo jmz szl psd nff wjm efg ghw gmu kui qga njd edv
|
||||
vck: qse yfm yns xmf meo
|
||||
hfz: amb
|
||||
fox: zqk amb
|
||||
rnh: qph pmi
|
||||
utm: kxp pdj
|
||||
ham: hhm bkp
|
||||
ljo: cwu
|
||||
qse: szb eoh thr tzd
|
||||
auf: cst iet
|
||||
wlo: rah kep shp
|
||||
osj: iuj zme xzb
|
||||
qga: qjq ago pdq jlx
|
||||
tdt: zmi gex kvd
|
||||
mzt: rhu you
|
||||
cby: wnm wrc wcy mxe
|
||||
pdr: tzm
|
||||
nnb: ixo unv
|
||||
kvn: vbh acl iut
|
||||
wpi: uqc
|
||||
txp: zqk amb
|
||||
tcg: wrc
|
||||
xzb: mtn
|
||||
hca: ljo fft
|
||||
fgc: wfp crf
|
||||
vis: riz
|
||||
ehk: yoy qjk tvq
|
||||
kwj: nss edl
|
||||
kzn: ciy suk
|
||||
nav: you
|
||||
wew: kep
|
||||
xvy: djs
|
||||
rss: ygf wuh qrz
|
||||
buo: cby smw
|
||||
cld: wpi
|
||||
keu: jyp
|
||||
fss: uwc iet cst ybf
|
||||
inn: osj
|
||||
tjp: teb
|
||||
kxp: twr fcf phr
|
||||
phr: wdx jck
|
||||
pav: rnk vbl ihp
|
||||
wdx: kym xhl
|
||||
jck: kym xhl ehk zxb
|
||||
otj: zmi kvd gex
|
||||
nmh: xru ykn fcf phr
|
||||
uah: wrd fsd cza
|
||||
ors: kwj qhz mpe
|
||||
cwu: iad qod
|
||||
hgx: gak
|
||||
clb: upb
|
||||
pdq: lmp qxa tgo
|
||||
hyw: hke clh ixu sen
|
||||
qpt: mud ogi
|
||||
gao: tzp
|
||||
mxe: iul vvw zhx zbl eiq zzi wyl rjz dwe ich bvo axx asm rqm sex
|
||||
tco: vjv enl tji
|
||||
ivx: ciy
|
||||
rzi: raf wig yvt
|
||||
fdh: nsy kui zld qga edv nff wlp pcv
|
||||
kud: kix gsl boq
|
||||
kuh: raj ekp mog rqt
|
||||
ski: huu upv
|
||||
axx: otj tdt
|
||||
fmx: gxw pgw kuh
|
||||
lay: ljo krb bue
|
||||
ipt: zqk
|
||||
vls: sjn iau
|
||||
fkj: vls dzt
|
||||
vyy: awf ank hsj aum tvb
|
||||
qnk: ywj
|
||||
smw: wnm wcy mxe wrc
|
||||
tsz: wcy wnm
|
||||
iet: lmq gjp clu fkh kud rbx hph qdi gnn vff jnv nvs gdk pqk qpn zsb jah xtf tjp miz
|
||||
uwc: qdi hph rbx jnv vff gnn clu gjp fkh kud xtf jah zsb qpn miz tjp gdk pqk nvs
|
||||
agv: cvb beo vjr
|
||||
aqo: kay
|
||||
meo: thr tzd szb eoh
|
||||
ckk: qfj fmx xez
|
||||
acp: udg
|
||||
jyp: fsd wrd
|
||||
mng: hgd ljv fpv
|
||||
vuy: hzl ght hwj
|
||||
tew: raf wig
|
||||
zmi: hnj ybf iet
|
||||
ltl: wrc
|
||||
ode: vls xqf
|
||||
clu: fiw teb
|
||||
loh: ihp
|
||||
zhx: blv zvr hfm acp
|
||||
daq: uwc hnj ybf
|
||||
xll: osu dvn ywj fek
|
||||
dro: fwg ywm qox
|
||||
kkc: fcw
|
||||
frk: wcy mxe wnm
|
||||
oao: nji uho uou jmz wlp swt ghw zld gmu kui efg pcv pwe njd
|
||||
gdk: htw ffk ozg wrg phe
|
||||
ccy: ogv
|
||||
ogv: rhu you
|
||||
oio: gsu
|
||||
rgx: osj
|
||||
zae: jmw kgy zlb sdy yby clx quj hon oam gux erz zxj rlz eji loh clb vhq vae
|
||||
ucd: wrc wcy mxe wnm
|
||||
zqk: jfl gfh tqc hbz fui hnb btv fzn inn szw npa spb avz lqy keu rnh
|
||||
yiw: eya uah
|
||||
xmf: eoh
|
||||
zri: mtn oao fdh
|
||||
wlp: onk
|
||||
xpd: lga
|
||||
odx: wzs xpd
|
||||
you: cil xvy sin iph jkl doo cxl upe fga wdd utm azz bbx tsq bsx svm pmq ieg
|
||||
raj: jdc
|
||||
wyb: wkt
|
||||
doo: wxs ymh
|
||||
aiz: kvd edz
|
||||
ksm: ldk
|
||||
crf: sdo
|
||||
bvq: ybf hnj iet
|
||||
anb: raj mog rqt
|
||||
znf: iet cst hnj ybf
|
||||
cst: xtf hph rbx rda fkh kud pqk lmq
|
||||
omy: kwj qhz mpe
|
||||
tlc: mnv hgd ljv
|
||||
gfh: fgc hsm krw
|
||||
nka: qbq tfg kbb
|
||||
xqf: sjn znf ssj
|
||||
qhj: tet gzl dil djh arw
|
||||
ety: ywm fwg ccm qox kow
|
||||
awn: ivx kxo kzn
|
||||
yfk: you rhu jny
|
||||
sff: fdj amb zqk
|
||||
zhi: wsy tdm kkc
|
||||
hsd: vwr epe
|
||||
wgb: mtn rdj fdh
|
||||
qxm: lym frk smw
|
||||
xxf: kgd
|
||||
wqq: ogv
|
||||
jlx: tgo qxa lmp
|
||||
xuq: uwc hnj ybf
|
||||
rbx: kix boq gsl
|
||||
zxb: vyp qjk
|
||||
vbh: nkj tdu tiw
|
||||
qyj: qwn xuq csr
|
||||
xph: wrc wcy mxe
|
||||
joq: mxe wrc
|
||||
ezh: oaf yno ttk
|
||||
gqx: izq kzn ivx
|
||||
qjy: uwc iet ybf
|
||||
xjn: cfs hwj ght
|
||||
yru: fdj
|
||||
kxo: afp ciy
|
||||
gex: iet uwc cst
|
||||
qcy: out
|
||||
iau: hnj ybf uwc
|
||||
vru: huu mxh upv
|
||||
tji: rhu you
|
||||
qth: uwc cst
|
||||
tkt: jbw qvm wkt
|
||||
djs: ala
|
||||
gsl: sen hke
|
||||
dzt: iau znf sjn
|
||||
huu: nnb gek sce
|
||||
tsx: tji vjv nav enl
|
||||
cza: vxy kbh
|
||||
rrk: vyy dac
|
||||
sau: you rhu
|
||||
vda: ode
|
||||
iul: lay
|
||||
pqk: kix hyw
|
||||
srg: eob vks
|
||||
thr: smr joq orq nmn fxq
|
||||
dlt: cfs ght
|
||||
nky: wzs xpd
|
||||
eru: qod
|
||||
qbk: mtn oao rdj
|
||||
kep: amb fdj
|
||||
ttk: ixj mth buo qxm
|
||||
ugd: apr yno
|
||||
lqy: pmi vis rft qph
|
||||
qbq: ice ade
|
||||
kix: sen ixu
|
||||
rah: zqk amb
|
||||
zvr: mfj
|
||||
spb: ngf hsm yba fgc
|
||||
npa: yba fgc
|
||||
qpn: bon iox wew
|
||||
sex: tzp hca
|
||||
xuf: zri igi wgb
|
||||
oaf: qxm mth ixj
|
||||
upb: jet gar ohd
|
||||
mth: frk
|
||||
wcx: qjy xuq qwn ikw
|
||||
xez: kuh pgw ulx anb
|
||||
gjp: wrg
|
||||
ixj: frk lym cby smw
|
||||
riz: jbw wkt
|
||||
ybf: kud fkh clu gjp lmq jnv vff gnn hph rbx rda pqk gdk nvs miz tjp xtf zsb qpn
|
||||
gbi: jny rhu
|
||||
gek: unv jnt
|
||||
tet: rdj
|
||||
usk: ssi omy axc ors
|
||||
hgd: wnm mxe wcy wrc
|
||||
uie: amb
|
||||
qyl: xjn vuy uck
|
||||
hgt: kvn uxr
|
||||
xre: xzb iuj
|
||||
sdo: rdj oao mtn
|
||||
see: tzm tfl yol xll
|
||||
rqt: sau
|
||||
ank: nqq uhs
|
||||
utq: fdj zqk
|
||||
zvf: fsd
|
||||
acl: tdu nkj dtw
|
||||
svm: nmh pdj kxp
|
||||
teb: olu pdr
|
||||
iph: jvj fyb zmk djs
|
||||
vhq: lvd ezh mir rjt
|
||||
zme: mtn oao rdj
|
||||
kbb: wnk ice
|
||||
ymh: nky odx aqo
|
||||
uou: pdq urb qjq ago
|
||||
nng: rdj oao mtn
|
||||
fxq: wrc wcy mxe wnm
|
||||
qph: cld ybs wyb
|
||||
fdj: jyd avz szw usk piw qgn xja keu gfh yiw tqc fui fzn inn rgx
|
||||
vgr: out
|
||||
uhs: rhu jny
|
||||
swt: qjq ago urb pdq
|
||||
arw: fdh oao mtn
|
||||
ohu: fox utq rvu
|
||||
fmj: vbh iut
|
||||
lvd: yno apr ttk
|
||||
jwu: eji rlz zxj loh oio lav clb vhq vae xxf oam hon erz lpu clx sdy zlb jmw
|
||||
lvz: xgf lpi kek
|
||||
fek: amb fdj
|
||||
nze: uiv
|
||||
ala: ivx
|
||||
rnk: tcg
|
||||
fzm: out
|
||||
pxq: uco ggt vgr iya
|
||||
bgu: vyy ugx
|
||||
qox: tco tsx
|
||||
eji: lvd ugd ezh mir rjt
|
||||
cys: yfk
|
||||
vjr: wcx
|
||||
icp: zqk fdj
|
||||
hnj: gjp lmq kud hph qdi rbx jnv gdk pqk nvs xtf qpn
|
||||
izq: suk ciy
|
||||
kvd: uwc ybf
|
||||
kui: xez fmx
|
||||
ybs: jbw qvm wkt
|
||||
dwe: pxg fkj
|
||||
cab: agv hnx
|
||||
bue: tjq cwu
|
||||
olu: tfl qnk tzm yol
|
||||
wyl: kjy aef
|
||||
iuj: oao mtn fdh
|
||||
jet: dds
|
||||
udg: daq uno bvq
|
||||
jee: xee
|
||||
unv: out
|
||||
szw: rft qph pmi sio vis
|
||||
hnx: sfb vjr cvb
|
||||
ogi: djh gzl dil
|
||||
ccm: tsx
|
||||
dac: tvb awf hsj
|
||||
edv: epe vwr rrk bgu
|
||||
oul: mxe
|
||||
twr: ych
|
||||
juh: wgz daq qth
|
||||
wkt: czw uqc
|
||||
vxy: fdh
|
||||
zlb: kbm
|
||||
nqq: jny
|
||||
kay: cka
|
||||
rhp: csr xuq ikw qjy
|
||||
cvb: rhp gfz
|
||||
mpe: edl rnb
|
||||
rqm: ejd aiz
|
||||
boq: sen hke clh
|
||||
nmn: mxe wrc
|
||||
qpe: vru ski
|
||||
erz: srg
|
||||
eob: dlt uck xjn vuy
|
||||
eoh: nmn
|
||||
rjh: uie yru sff
|
||||
fkh: rzi
|
||||
azz: jee ldg
|
||||
hnd: ubz ddd
|
||||
tzm: osu dvn ywj
|
||||
yno: qxm buo ixj
|
||||
wcy: gao zbl eiq sue rqm dwe sex
|
||||
rnb: erv
|
||||
ecv: oek rss bwi
|
||||
jqk: tji aqf
|
||||
vyp: out
|
||||
bbx: djs jvj zmk
|
||||
tdu: out
|
||||
szb: smr orq fxq
|
||||
try: vks
|
||||
ugx: hsj ank tvb
|
||||
piw: axc
|
||||
hbz: osj qqr xre
|
||||
hnb: qhj ogi
|
||||
vsf: acp
|
||||
tsq: kxp pdj nmh
|
||||
pmq: nmh
|
||||
bol: oao
|
||||
osu: amb fdj
|
||||
kbh: mtn rdj
|
||||
vff: yso rzi tew
|
||||
vks: xjn vuy eju dlt
|
||||
szl: bgu
|
||||
met: fhi cui oul tsz
|
||||
csz: xmf yfm
|
||||
uco: out
|
||||
ldg: vru alk
|
||||
ljv: wrc
|
||||
lpi: xph ltl ucd
|
||||
tzp: ljo ipq fft
|
||||
cfs: wnm wcy mxe
|
||||
yoy: out
|
||||
pxg: xqf dzt
|
||||
jyd: mud ogi
|
||||
nvs: fiw jqd
|
||||
awf: nqq uhs
|
||||
efd: qqr xre
|
||||
kcm: out
|
||||
rda: ffk ozg phe
|
||||
rft: wyb ybs
|
||||
gux: xcy pob
|
||||
rvu: amb fdj zqk
|
||||
asm: pxg
|
||||
mnv: wnm mxe wcy
|
||||
vwr: vyy
|
||||
bsx: riq
|
||||
dds: mnv ljv hgd
|
||||
jyz: fdh mtn rdj
|
||||
fsd: nng kbh vxy
|
||||
erv: mtn
|
||||
wig: rjh ydz hhm
|
||||
mmb: nky odx
|
||||
mud: dil gzl djh
|
||||
aef: oek bwi
|
||||
gzu: dat lar
|
||||
qvm: swf uqc
|
||||
hsj: uhs
|
||||
oek: wuh qrz ygf fss
|
||||
gak: fev muf ubz ddd
|
||||
zxj: uyw pob
|
||||
smr: wrc wcy
|
||||
lpu: srg
|
||||
zxd: amb fdj zqk
|
||||
dtw: out
|
||||
qod: iet hnj cst ybf
|
||||
fcf: wdx ych
|
||||
gxw: ekp rqt mog
|
||||
qdi: boq gsl kix
|
||||
fga: zhi
|
||||
kgd: yfm meo yns
|
||||
edl: qbk ncd
|
||||
riq: xee ski
|
||||
ago: qxa lmp
|
||||
ikw: iet
|
||||
jfl: hsm ngf
|
||||
ngf: wfp exk
|
||||
apr: mth qxm buo
|
||||
dvn: zqk amb fdj
|
||||
rew: uah eya jyp zvf
|
||||
fcw: lar fec
|
||||
vzx: qse
|
||||
fev: fmj kvn
|
||||
ihv: ljv
|
||||
phe: kgs rpq txp hfz
|
||||
lar: ggt iya
|
||||
ieg: nmk okh
|
||||
jny: svm arp iph bsx tsq rlu wdd upe hgx
|
||||
wdd: hkh
|
||||
zsb: boq hyw
|
||||
kbm: eda lvz
|
||||
osz: fox utq
|
||||
tof: mmb
|
||||
suk: lgn gbv qcy
|
||||
nji: dro onk
|
||||
qgn: sio qph rft
|
||||
sin: zmk djs
|
||||
bkp: sff ggp
|
||||
ixu: pfg vpy ohu
|
||||
tvq: out
|
||||
ixo: out
|
||||
orq: wnm wrc wcy
|
||||
upe: hkh hnd
|
||||
iox: icp
|
||||
hfm: juh
|
||||
czw: oao
|
||||
eju: hzl
|
||||
fft: eru gmo
|
||||
rjz: acp hfm blv
|
||||
vae: nze bbl
|
||||
ade: you rhu
|
||||
psd: daw
|
||||
njd: qbq
|
||||
rhu: bbx bsx utm hgx tof upe ieg pmq svm sin rlu xvy cxl doo jkl iph
|
||||
jqd: pdr olu see
|
||||
sue: lay hca
|
||||
fec: ggt
|
||||
ubz: fmj
|
||||
iad: hnj ybf uwc iet
|
||||
pcv: pdq
|
||||
ncd: fdh rdj oao
|
||||
rpq: zqk fdj
|
||||
hph: rzi tew
|
||||
wjm: ykx wqq cys
|
||||
kjy: bwi rss
|
||||
bwi: qrz
|
||||
hke: ohu
|
||||
jmw: adu
|
||||
wfp: igi wgb
|
||||
dil: oao
|
||||
rlz: met
|
||||
hsm: wfp xuf qqf crf
|
||||
sjn: uwc ybf
|
||||
muf: kvn uxr
|
||||
mgk: ejd cyg tdt
|
||||
gmo: qod iad auf
|
||||
xja: pmi
|
||||
pdj: ykn phr fcf
|
||||
gsu: vks qyl
|
||||
ykn: ych wdx
|
||||
ssj: uwc ybf cst
|
||||
xcy: ohd jet
|
||||
zld: bgu rrk epe
|
||||
myu: sfb beo
|
||||
rpf: qod opa
|
||||
sfb: jiq gfz
|
||||
igi: mtn
|
||||
tfg: ade
|
||||
nff: ety dro
|
||||
epe: ugx
|
||||
iut: nkj tdu tiw
|
||||
shp: zqk
|
||||
onk: qox kow fwg
|
||||
yso: ham
|
||||
wgz: iet cst hnj
|
||||
afp: gbv
|
||||
cyg: kvd edz
|
||||
ggt: out
|
||||
iya: out
|
||||
oam: vck
|
||||
tiw: out
|
||||
eyu: out
|
||||
sio: wyb cld tkt
|
||||
ssi: qhz mpe
|
||||
uho: xez fmx
|
||||
hwj: wnm mxe wcy
|
||||
sdy: csz
|
||||
uno: cst hnj iet uwc
|
||||
wrd: nng kbh vxy
|
||||
btv: ors
|
||||
miz: tew yso
|
||||
okh: kkc wsy
|
||||
yvt: ydz
|
||||
ych: zxb
|
||||
zbl: ejd cyg otj tdt
|
||||
csr: iet uwc cst
|
||||
jmz: onb ykx ccy
|
||||
tvb: fvc
|
||||
ypl: jmw sdy yby kgy erz syo pav gux oam hon clb oio lav yfa loh zxj rlz eji
|
||||
kgs: zqk
|
||||
mir: apr oaf yno
|
||||
woy: ihv dds mng
|
||||
ght: wnm mxe wrc
|
||||
ich: tzp hca
|
||||
onb: ogv mzt yfk
|
||||
syo: kgd vzx
|
||||
rdj: szl nji uou nsy yqo nff wjm zld gmu efg njd uho ckk wlp swt psd ghw kui hsd nka qga edv
|
||||
wxs: nky
|
||||
uyw: gar
|
||||
ygf: iet
|
||||
ydz: ggp yru uie
|
||||
amb: qgn avz szw npa hnb rgx tqc yiw jfl gfh efd piw rnh keu jyd usk rew spb btv fzn qpt fui hbz
|
||||
swf: mtn fdh
|
||||
fyb: gqx ala awn
|
||||
ywj: fdj
|
||||
ozg: rpq vug
|
||||
ulx: raj hza rqt
|
||||
tqc: eya jyp zvf uah
|
||||
nsy: xez
|
||||
jiq: ikw xuq qwn qjy csr
|
||||
yfa: ugd ezh
|
||||
eiq: ode fkj
|
||||
wrc: vvw cab vda ich gao sue sex amf iul zhx hjp zbl zzi wyl eiq rjz mgk dwe vsf bvo axx asm efw rqm
|
||||
yns: tzd
|
||||
wsy: gzu pbi fcw
|
||||
lmq: bon wew iox
|
||||
bvo: myu
|
||||
quj: rnk met
|
||||
krw: xuf wfp
|
||||
gbv: out
|
||||
qhz: rnb
|
||||
lym: wrc wnm
|
||||
jdc: rhu you
|
||||
axc: qhz mpe
|
||||
wnm: iul hjp rjz cab mgk eiq zzi wyl bvo ich asm axx
|
||||
mog: sau gbi
|
||||
krb: rpf
|
||||
eya: fsd cza
|
||||
fne: rhu you
|
||||
cka: ldk eyu ufk
|
||||
hhm: uie
|
||||
alk: trj
|
||||
ejd: gex
|
||||
bbl: uiv
|
||||
jah: wlo iox
|
||||
BIN
src/.DS_Store
vendored
Normal file
BIN
src/.DS_Store
vendored
Normal file
Binary file not shown.
7
src/day01/Cargo.lock
generated
7
src/day01/Cargo.lock
generated
@@ -1,7 +0,0 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "day01"
|
||||
version = "0.1.0"
|
||||
@@ -1,6 +0,0 @@
|
||||
[package]
|
||||
name = "day01"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
28
src/day01/mod.rs
Normal file
28
src/day01/mod.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
pub mod part01a;
|
||||
pub mod part01b;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::day01::{part01a, part01b};
|
||||
|
||||
const PUZZLE: &str = "L68
|
||||
L30
|
||||
R48
|
||||
L5
|
||||
R60
|
||||
L55
|
||||
L1
|
||||
L99
|
||||
R14
|
||||
L82";
|
||||
|
||||
#[test]
|
||||
fn part01a() {
|
||||
assert_eq!(part01a::solve(PUZZLE), 3);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn part01b() {
|
||||
assert_eq!(part01b::solve(PUZZLE), 6);
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,9 @@
|
||||
use std::fs::File;
|
||||
use std::io::Read;
|
||||
|
||||
pub fn solve() -> u64 {
|
||||
pub fn solve(puzzle: &str) -> u64 {
|
||||
let mut solution: u64 = 0;
|
||||
|
||||
let mut file: File = File::open("src/day01/input01.txt").unwrap();
|
||||
let mut file_content: String = String::new();
|
||||
file.read_to_string(&mut file_content).expect("Can't read file");
|
||||
|
||||
let mut dial: i32 = 50;
|
||||
file_content.split("\n").enumerate().for_each(|(_, line)| {
|
||||
puzzle.split("\n").enumerate().for_each(|(_, line)| {
|
||||
let direction: i32 = match &line[0..1] {
|
||||
"L" => -1,
|
||||
"R" => 1,
|
||||
@@ -1,15 +1,9 @@
|
||||
use std::fs::File;
|
||||
use std::io::Read;
|
||||
|
||||
pub fn solve() -> u64 {
|
||||
pub fn solve(puzzle: &str) -> u64 {
|
||||
let mut solution: u64 = 0;
|
||||
|
||||
let mut file: File = File::open("src/day01/input01.txt").unwrap();
|
||||
let mut file_content: String = String::new();
|
||||
file.read_to_string(&mut file_content).expect("Can't read file");
|
||||
|
||||
let mut dial: i32 = 50;
|
||||
file_content.split("\n").enumerate().for_each(|(_, line)| {
|
||||
puzzle.split("\n").enumerate().for_each(|(_, line)| {
|
||||
let direction: i32 = match &line[0..1] {
|
||||
"L" => -1,
|
||||
"R" => 1,
|
||||
@@ -28,7 +22,7 @@ pub fn solve() -> u64 {
|
||||
solution += 1;
|
||||
dial -= 100;
|
||||
}
|
||||
dial = (dial + 100000) % 100;
|
||||
dial = (dial + 100000) % 100;
|
||||
if dial == 0 {
|
||||
solution += 1;
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
pub mod part01a;
|
||||
pub mod part01b;
|
||||
7
src/day02/Cargo.lock
generated
7
src/day02/Cargo.lock
generated
@@ -1,7 +0,0 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "day02"
|
||||
version = "0.1.0"
|
||||
@@ -1,6 +0,0 @@
|
||||
[package]
|
||||
name = "day02"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
19
src/day02/mod.rs
Normal file
19
src/day02/mod.rs
Normal file
@@ -0,0 +1,19 @@
|
||||
pub mod part02a;
|
||||
pub mod part02b;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::day02::{part02a, part02b};
|
||||
|
||||
const PUZZLE: &str = "11-22,95-115,998-1012,1188511880-1188511890,222220-222224,1698522-1698528,446443-446449,38593856-38593862,565653-565659,824824821-824824827,2121212118-2121212124";
|
||||
|
||||
#[test]
|
||||
fn part02a() {
|
||||
assert_eq!(part02a::solve(PUZZLE), 1227775554);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn part02b() {
|
||||
assert_eq!(part02b::solve(PUZZLE), 4174379265);
|
||||
}
|
||||
}
|
||||
27
src/day02/part02a.rs
Normal file
27
src/day02/part02a.rs
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
pub fn solve(puzzle: &str) -> u64 {
|
||||
let mut solution: u64 = 0;
|
||||
|
||||
puzzle.split(",").for_each(|id_range| {
|
||||
match id_range.split_once("-") {
|
||||
Some((a, b)) => {
|
||||
a.parse::<usize>().expect("invalid range start")
|
||||
..b.parse::<usize>().expect("invalid range end")+1
|
||||
}
|
||||
None => panic!("Invalid id range"),
|
||||
}
|
||||
.for_each(|id| {
|
||||
let id_len = id.ilog10() as usize + 1;
|
||||
if id_len % 2 == 1 {
|
||||
return;
|
||||
}
|
||||
let half_pow = 10usize.pow(id_len as u32 / 2);
|
||||
if id / half_pow == id % half_pow {
|
||||
solution += id as u64
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
solution
|
||||
}
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
use std::fs::File;
|
||||
use std::io::Read;
|
||||
|
||||
pub fn solve() -> u64 {
|
||||
pub fn solve(puzzle: &str) -> u64 {
|
||||
let mut solution: u64 = 0;
|
||||
|
||||
let mut file: File = File::open("src/day02/input02.txt").unwrap();
|
||||
let mut file_content: String = String::new();
|
||||
file.read_to_string(&mut file_content).expect("Can't read file");
|
||||
|
||||
file_content.split(",").for_each(|id_range| {
|
||||
puzzle.split(",").for_each(|id_range| {
|
||||
match id_range.split_once("-") {
|
||||
Some((a, b)) => a.parse::<usize>().expect("invalid range start")..b.parse::<usize>().expect("invalid range end"),
|
||||
Some((a, b)) => {
|
||||
a.parse::<usize>().expect("invalid range start")
|
||||
..b.parse::<usize>().expect("invalid range end")+1
|
||||
}
|
||||
None => panic!("Invalid id range"),
|
||||
}.for_each(|id| {
|
||||
}
|
||||
.for_each(|id| {
|
||||
let id_len = id.ilog10() as usize + 1;
|
||||
|
||||
// try subdivide into 1..len/2 numbers
|
||||
for j in 1..id_len/2 + 1 {
|
||||
for j in 1..id_len / 2 + 1 {
|
||||
// no clean subdivision
|
||||
if id_len % j != 0 {continue}
|
||||
if id_len % j != 0 {
|
||||
continue;
|
||||
}
|
||||
|
||||
// perform subdivision as map
|
||||
let mut i = (j..id_len+1).step_by(j).map(|i|
|
||||
(id / 10usize.pow((id_len - i) as u32)) % 10usize.pow(j as u32)
|
||||
);
|
||||
let mut i = (j..id_len + 1)
|
||||
.step_by(j)
|
||||
.map(|i| (id / 10usize.pow((id_len - i) as u32)) % 10usize.pow(j as u32));
|
||||
|
||||
// check or equal parts
|
||||
let all_equal = if let Some(first) = i.next() {
|
||||
@@ -42,4 +42,5 @@ pub fn solve() -> u64 {
|
||||
});
|
||||
|
||||
solution
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
pub mod part02a;
|
||||
pub mod part02b;
|
||||
@@ -1,24 +0,0 @@
|
||||
use std::fs::File;
|
||||
use std::io::Read;
|
||||
|
||||
pub fn solve() -> u64 {
|
||||
let mut solution: u64 = 0;
|
||||
|
||||
let mut file: File = File::open("src/day02/input02.txt").unwrap();
|
||||
let mut file_content: String = String::new();
|
||||
file.read_to_string(&mut file_content).expect("Can't read file");
|
||||
|
||||
file_content.split(",").for_each(|id_range| {
|
||||
match id_range.split_once("-") {
|
||||
Some((a, b)) => a.parse::<usize>().expect("invalid range start")..b.parse::<usize>().expect("invalid range end"),
|
||||
None => panic!("Invalid id range"),
|
||||
}.for_each(|id| {
|
||||
let id_len = id.ilog10() as usize + 1;
|
||||
if id_len % 2 == 1 { return }
|
||||
let half_pow = 10usize.pow(id_len as u32 / 2);
|
||||
if id / half_pow == id % half_pow { solution += id as u64 }
|
||||
});
|
||||
});
|
||||
|
||||
solution
|
||||
}
|
||||
7
src/day03/Cargo.lock
generated
7
src/day03/Cargo.lock
generated
@@ -1,7 +0,0 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "day03"
|
||||
version = "0.1.0"
|
||||
@@ -1,7 +0,0 @@
|
||||
[package]
|
||||
name = "day03"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
iter-first-max = "0.1.2"
|
||||
22
src/day03/mod.rs
Normal file
22
src/day03/mod.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
pub mod part03a;
|
||||
pub mod part03b;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::day03::{part03a, part03b};
|
||||
|
||||
const PUZZLE: &str = "987654321111111
|
||||
811111111111119
|
||||
234234234234278
|
||||
818181911112111";
|
||||
|
||||
#[test]
|
||||
fn part03a() {
|
||||
assert_eq!(part03a::solve(PUZZLE), 357);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn part03b() {
|
||||
assert_eq!(part03b::solve(PUZZLE), 3121910778619);
|
||||
}
|
||||
}
|
||||
25
src/day03/part03a.rs
Normal file
25
src/day03/part03a.rs
Normal file
@@ -0,0 +1,25 @@
|
||||
use iter_first_max::IterFirstMaxExt;
|
||||
|
||||
pub fn solve(puzzle: &str) -> u64 {
|
||||
let mut solution: u64 = 0;
|
||||
|
||||
puzzle.lines().for_each(|battery_bank| {
|
||||
let batteries = battery_bank
|
||||
.chars()
|
||||
.map(|c| c as u8 - 0x30)
|
||||
.collect::<Vec<u8>>();
|
||||
let (i, biggest_battery) = batteries
|
||||
.iter()
|
||||
.enumerate()
|
||||
.first_max_by_key(|(_, v)| *v)
|
||||
.unwrap();
|
||||
solution += if i < battery_bank.len() - 1 {
|
||||
10 * biggest_battery + batteries[i + 1..].iter().max().unwrap()
|
||||
} else {
|
||||
10 * batteries[..i].iter().max().unwrap() + biggest_battery
|
||||
} as u64;
|
||||
});
|
||||
|
||||
solution
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
use std::fs::File;
|
||||
use std::io::Read;
|
||||
use iter_first_max::IterFirstMaxExt;
|
||||
|
||||
fn get_n_max(vec: &Vec<u8>, n: usize) -> Vec<u8> {
|
||||
@@ -14,10 +12,9 @@ fn get_n_max(vec: &Vec<u8>, n: usize) -> Vec<u8> {
|
||||
max.push(*biggest);
|
||||
if i > vec.len() - 1 - n {
|
||||
n -= vec.len() - i - 1;
|
||||
max.append(&mut vec[i+1..].to_vec());
|
||||
}
|
||||
else {
|
||||
let mut found = get_n_max(&vec[i+1..].to_vec(), n);
|
||||
max.append(&mut vec[i + 1..].to_vec());
|
||||
} else {
|
||||
let mut found = get_n_max(&vec[i + 1..].to_vec(), n);
|
||||
n -= found.len();
|
||||
max.append(&mut found);
|
||||
}
|
||||
@@ -34,19 +31,22 @@ fn get_n_max(vec: &Vec<u8>, n: usize) -> Vec<u8> {
|
||||
max
|
||||
}
|
||||
|
||||
pub fn solve() -> u64 {
|
||||
pub fn solve(puzzle: &str) -> u64 {
|
||||
let mut solution: u64 = 0;
|
||||
|
||||
let mut file: File = File::open("src/day03/input03.txt").unwrap();
|
||||
let mut file_content: String = String::new();
|
||||
file.read_to_string(&mut file_content).expect("Can't read file");
|
||||
|
||||
file_content.lines().for_each(|battery_bank| {
|
||||
let batteries = battery_bank.chars().map(|c| c as u8 - 0x30).collect::<Vec<u8>>();
|
||||
get_n_max(&batteries, 12).iter().enumerate().for_each(|(i, battery)| {
|
||||
solution += *battery as u64 * 10u64.pow(11 - i as u32);
|
||||
});
|
||||
puzzle.lines().for_each(|battery_bank| {
|
||||
let batteries = battery_bank
|
||||
.chars()
|
||||
.map(|c| c as u8 - 0x30)
|
||||
.collect::<Vec<u8>>();
|
||||
get_n_max(&batteries, 12)
|
||||
.iter()
|
||||
.enumerate()
|
||||
.for_each(|(i, battery)| {
|
||||
solution += *battery as u64 * 10u64.pow(11 - i as u32);
|
||||
});
|
||||
});
|
||||
|
||||
solution
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
pub mod part03a;
|
||||
pub mod part03b;
|
||||
@@ -1,23 +0,0 @@
|
||||
use std::fs::File;
|
||||
use std::io::Read;
|
||||
use iter_first_max::IterFirstMaxExt;
|
||||
|
||||
pub fn solve() -> u64 {
|
||||
let mut solution: u64 = 0;
|
||||
|
||||
let mut file: File = File::open("src/day03/input03.txt").unwrap();
|
||||
let mut file_content: String = String::new();
|
||||
file.read_to_string(&mut file_content).expect("Can't read file");
|
||||
|
||||
file_content.lines().for_each(|battery_bank| {
|
||||
let batteries = battery_bank.chars().map(|c| c as u8 - 0x30).collect::<Vec<u8>>();
|
||||
let (i, biggest_battery) = batteries.iter().enumerate().first_max_by_key(|(_, v)| *v).unwrap();
|
||||
solution += if i < battery_bank.len()-1 {
|
||||
10 * biggest_battery + batteries[i+1..].iter().max().unwrap()
|
||||
} else {
|
||||
10 * batteries[..i].iter().max().unwrap() + biggest_battery
|
||||
} as u64;
|
||||
});
|
||||
|
||||
solution
|
||||
}
|
||||
7
src/day04/Cargo.lock
generated
7
src/day04/Cargo.lock
generated
@@ -1,7 +0,0 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "day04"
|
||||
version = "0.1.0"
|
||||
@@ -1,6 +0,0 @@
|
||||
[package]
|
||||
name = "day04"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
64
src/day04/common.rs
Normal file
64
src/day04/common.rs
Normal file
@@ -0,0 +1,64 @@
|
||||
|
||||
pub fn parse_to_floor(input: &str) -> Vec<Vec<u8>> {
|
||||
let mut rows: Vec<Vec<u8>> = Vec::with_capacity(input.len() + 2);
|
||||
rows.push(vec![0u8; input.len()]);
|
||||
rows.append(
|
||||
&mut input
|
||||
.lines()
|
||||
.map(|line| {
|
||||
let mut col: Vec<u8> = Vec::with_capacity(line.len() + 2);
|
||||
col.push(0u8);
|
||||
col.append(
|
||||
&mut line
|
||||
.chars()
|
||||
.map(|c| match c {
|
||||
'@' => 1u8,
|
||||
_ => 0u8,
|
||||
})
|
||||
.collect(),
|
||||
);
|
||||
col.push(0u8);
|
||||
col
|
||||
})
|
||||
.collect(),
|
||||
);
|
||||
rows.push(vec![0u8; input.len()]);
|
||||
|
||||
rows
|
||||
}
|
||||
|
||||
pub fn remove_if_possible(floor: &mut Vec<Vec<u8>>) -> Option<u64> {
|
||||
let mut removed: Vec<(usize, usize)> = Vec::new();
|
||||
|
||||
floor
|
||||
.windows(3)
|
||||
.enumerate()
|
||||
.for_each(|(r, rows)| {
|
||||
rows[0]
|
||||
.iter()
|
||||
.zip(rows[1].iter())
|
||||
.zip(rows[2].iter())
|
||||
.map(|((a, b), c)| (a, b, c))
|
||||
.collect::<Vec<(&u8, &u8, &u8)>>()
|
||||
.windows(3)
|
||||
.enumerate()
|
||||
.for_each(|(c, cols)| {
|
||||
if cols[1].1 == &0u8 {
|
||||
return;
|
||||
}
|
||||
if cols.iter().map(|(a, b, c)| *a + *b + *c).sum::<u8>() - 1 < 4 {
|
||||
removed.push((r+1, c+1));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
removed.iter().for_each(|(r, c)| {
|
||||
floor[*r][*c] = 0;
|
||||
});
|
||||
|
||||
if removed.len() == 0 {
|
||||
return None;
|
||||
}
|
||||
|
||||
Some(removed.len() as u64)
|
||||
}
|
||||
29
src/day04/mod.rs
Normal file
29
src/day04/mod.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
pub mod part04a;
|
||||
pub mod part04b;
|
||||
mod common;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::day04::{part04a, part04b};
|
||||
|
||||
const PUZZLE: &str = "..@@.@@@@.
|
||||
@@@.@.@.@@
|
||||
@@@@@.@.@@
|
||||
@.@@@@..@.
|
||||
@@.@@@@.@@
|
||||
.@@@@@@@.@
|
||||
.@.@.@.@@@
|
||||
@.@@@.@@@@
|
||||
.@@@@@@@@.
|
||||
@.@.@@@.@.";
|
||||
|
||||
#[test]
|
||||
fn part04a() {
|
||||
assert_eq!(part04a::solve(PUZZLE), 13);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn part04b() {
|
||||
assert_eq!(part04b::solve(PUZZLE), 43);
|
||||
}
|
||||
}
|
||||
5
src/day04/part04a.rs
Normal file
5
src/day04/part04a.rs
Normal file
@@ -0,0 +1,5 @@
|
||||
use crate::day04::common::{parse_to_floor, remove_if_possible};
|
||||
|
||||
pub fn solve(puzzle: &str) -> u64 {
|
||||
remove_if_possible(&mut parse_to_floor(puzzle)).unwrap_or_else(|| 0)
|
||||
}
|
||||
15
src/day04/part04b.rs
Normal file
15
src/day04/part04b.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
use crate::day04::common::{parse_to_floor, remove_if_possible};
|
||||
|
||||
pub fn solve(puzzle: &str) -> u64 {
|
||||
let mut solution: u64 = 0;
|
||||
let mut floor = parse_to_floor(puzzle);
|
||||
|
||||
while let Some(removed) = remove_if_possible(&mut floor) {
|
||||
solution += removed;
|
||||
}
|
||||
|
||||
solution
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
pub mod part04a;
|
||||
pub mod part04b;
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
use std::fs::File;
|
||||
use std::io::Read;
|
||||
|
||||
pub fn solve() -> u64 {
|
||||
let mut solution: u64 = 0;
|
||||
|
||||
let mut file: File = File::open("src/day04/input04.txt").unwrap();
|
||||
let mut file_content: String = String::new();
|
||||
file.read_to_string(&mut file_content)
|
||||
.expect("Can't read file");
|
||||
|
||||
let mut rows: Vec<Vec<u8>> = Vec::with_capacity(file_content.len() + 2);
|
||||
rows.push(vec![0u8; file_content.len()]);
|
||||
rows.append(
|
||||
&mut file_content
|
||||
.lines()
|
||||
.map(|line| {
|
||||
let mut col: Vec<u8> = Vec::with_capacity(line.len() + 2);
|
||||
col.push(0u8);
|
||||
col.append(
|
||||
&mut line
|
||||
.chars()
|
||||
.map(|c| match c {
|
||||
'@' => 1u8,
|
||||
_ => 0u8,
|
||||
})
|
||||
.collect(),
|
||||
);
|
||||
col.push(0u8);
|
||||
col
|
||||
})
|
||||
.collect(),
|
||||
);
|
||||
rows.push(vec![0u8; file_content.len()]);
|
||||
|
||||
rows.windows(3).for_each(|rows| {
|
||||
rows[0]
|
||||
.iter()
|
||||
.zip(rows[1].iter())
|
||||
.zip(rows[2].iter())
|
||||
.map(|((a, b), c)| (*a, *b, *c))
|
||||
.collect::<Vec<(u8, u8, u8)>>()
|
||||
.windows(3)
|
||||
.for_each(|cols| {
|
||||
if cols[1].1 != 1u8 {
|
||||
return;
|
||||
}
|
||||
if cols.iter().map(|(a, b, c)| *a + *b + *c).sum::<u8>() - 1 < 4 {
|
||||
solution += 1;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
solution
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
use std::fs::File;
|
||||
use std::io::Read;
|
||||
|
||||
pub fn solve() -> u64 {
|
||||
let mut solution: u64 = 0;
|
||||
|
||||
let mut file: File = File::open("src/day04/input04.txt").unwrap();
|
||||
let mut file_content: String = String::new();
|
||||
file.read_to_string(&mut file_content)
|
||||
.expect("Can't read file");
|
||||
|
||||
solution
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
--- Day 3: Lobby ---
|
||||
|
||||
You descend a short staircase, enter the surprisingly vast lobby, and are quickly cleared by the security checkpoint. When you get to the main elevators, however, you discover that each one has a red light above it: they're all offline.
|
||||
|
||||
"Sorry about that," an Elf apologizes as she tinkers with a nearby control panel. "Some kind of electrical surge seems to have fried them. I'll try to get them online soon."
|
||||
|
||||
You explain your need to get further underground. "Well, you could at least take the escalator down to the printing department, not that you'd get much further than that without the elevators working. That is, you could if the escalator weren't also offline."
|
||||
|
||||
"But, don't worry! It's not fried; it just needs power. Maybe you can get it running while I keep working on the elevators."
|
||||
|
||||
There are batteries nearby that can supply emergency power to the escalator for just such an occasion. The batteries are each labeled with their joltage rating, a value from 1 to 9. You make a note of their joltage ratings (your puzzle input). For example:
|
||||
|
||||
987654321111111
|
||||
811111111111119
|
||||
234234234234278
|
||||
818181911112111
|
||||
|
||||
The batteries are arranged into banks; each line of digits in your input corresponds to a single bank of batteries. Within each bank, you need to turn on exactly two batteries; the joltage that the bank produces is equal to the number formed by the digits on the batteries you've turned on. For example, if you have a bank like 12345 and you turn on batteries 2 and 4, the bank would produce 24 jolts. (You cannot rearrange batteries.)
|
||||
|
||||
You'll need to find the largest possible joltage each bank can produce. In the above example:
|
||||
|
||||
In 987654321111111, you can make the largest joltage possible, 98, by turning on the first two batteries.
|
||||
In 811111111111119, you can make the largest joltage possible by turning on the batteries labeled 8 and 9, producing 89 jolts.
|
||||
In 234234234234278, you can make 78 by turning on the last two batteries (marked 7 and 8).
|
||||
In 818181911112111, the largest joltage you can produce is 92.
|
||||
|
||||
The total output joltage is the sum of the maximum joltage from each bank, so in this example, the total output joltage is 98 + 89 + 78 + 92 = 357.
|
||||
|
||||
There are many batteries in front of you. Find the maximum joltage possible from each bank; what is the total output joltage?
|
||||
@@ -1,25 +0,0 @@
|
||||
--- Part Two ---
|
||||
|
||||
The escalator doesn't move. The Elf explains that it probably needs more joltage to overcome the static friction of the system and hits the big red "joltage limit safety override" button. You lose count of the number of times she needs to confirm "yes, I'm sure" and decorate the lobby a bit while you wait.
|
||||
|
||||
Now, you need to make the largest joltage by turning on exactly twelve batteries within each bank.
|
||||
|
||||
The joltage output for the bank is still the number formed by the digits of the batteries you've turned on; the only difference is that now there will be 12 digits in each bank's joltage output instead of two.
|
||||
|
||||
Consider again the example from before:
|
||||
|
||||
987654321111111
|
||||
811111111111119
|
||||
234234234234278
|
||||
818181911112111
|
||||
|
||||
Now, the joltages are much larger:
|
||||
|
||||
In 987654321111111, the largest joltage can be found by turning on everything except some 1s at the end to produce 987654321111.
|
||||
In the digit sequence 811111111111119, the largest joltage can be found by turning on everything except some 1s, producing 811111111119.
|
||||
In 234234234234278, the largest joltage can be found by turning on everything except a 2 battery, a 3 battery, and another 2 battery near the start to produce 434234234278.
|
||||
In 818181911112111, the joltage 888911112111 is produced by turning on everything except some 1s near the front.
|
||||
|
||||
The total output joltage is now much larger: 987654321111 + 811111111119 + 434234234278 + 888911112111 = 3121910778619.
|
||||
|
||||
What is the new total output joltage?
|
||||
29
src/day05/mod.rs
Normal file
29
src/day05/mod.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
pub mod part05a;
|
||||
pub mod part05b;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::day05::{part05a, part05b};
|
||||
|
||||
const PUZZLE: &str = "3-5
|
||||
10-14
|
||||
16-20
|
||||
12-18
|
||||
|
||||
1
|
||||
5
|
||||
8
|
||||
11
|
||||
17
|
||||
32";
|
||||
|
||||
#[test]
|
||||
fn part05a() {
|
||||
assert_eq!(part05a::solve(PUZZLE), 3);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn part05b() {
|
||||
assert_eq!(part05b::solve(PUZZLE), 14);
|
||||
}
|
||||
}
|
||||
15
src/day05/part05a.rs
Normal file
15
src/day05/part05a.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
pub fn solve(puzzle: &str) -> u64 {
|
||||
let (ranges, values) = puzzle.split_once("\n\n").unwrap();
|
||||
let ranges = ranges
|
||||
.lines()
|
||||
.map(|line| line.split_once('-').unwrap())
|
||||
.map(|(start, end)| start.parse::<usize>().unwrap()..end.parse::<usize>().unwrap()+1)
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
values
|
||||
.lines()
|
||||
.map(|line| line.parse::<usize>().unwrap())
|
||||
.filter(|&val| ranges.iter().any(|range| range.contains(&val)))
|
||||
.count() as u64
|
||||
}
|
||||
29
src/day05/part05b.rs
Normal file
29
src/day05/part05b.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
use itertools::Itertools;
|
||||
|
||||
pub fn solve(puzzle: &str) -> u64 {
|
||||
let (ranges, _) = puzzle.split_once("\n\n").unwrap();
|
||||
let mut last_end = u64::MIN;
|
||||
ranges
|
||||
.lines()
|
||||
.map(|line| line.split_once('-').unwrap())
|
||||
.map(|(start, end)| (start.parse::<u64>().unwrap(), end.parse::<u64>().unwrap()))
|
||||
.sorted_by_key(|&(start, _)| start)
|
||||
.map(|(start, end)| {
|
||||
if last_end >= end {
|
||||
return None
|
||||
}
|
||||
let local_last_end = last_end;
|
||||
last_end = end;
|
||||
if local_last_end < start {
|
||||
return Some((start, end));
|
||||
}
|
||||
Some((local_last_end+1, end))
|
||||
})
|
||||
.filter(|x| x.is_some())
|
||||
.map(|x| x.unwrap())
|
||||
.map(|(start, end)| end - start + 1)
|
||||
.sum()
|
||||
}
|
||||
|
||||
|
||||
|
||||
22
src/day06/mod.rs
Normal file
22
src/day06/mod.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
pub mod part06a;
|
||||
pub mod part06b;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::day06::{part06a, part06b};
|
||||
|
||||
const PUZZLE: &str = "123 328 51 64
|
||||
45 64 387 23
|
||||
6 98 215 314
|
||||
* + * + ";
|
||||
|
||||
#[test]
|
||||
fn part06a() {
|
||||
assert_eq!(part06a::solve(PUZZLE), 4277556);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn part06b() {
|
||||
assert_eq!(part06b::solve(PUZZLE), 3263827);
|
||||
}
|
||||
}
|
||||
27
src/day06/part06a.rs
Normal file
27
src/day06/part06a.rs
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
pub fn solve(puzzle: &str) -> u64 {
|
||||
let mut iters: Vec<_> = puzzle
|
||||
.lines()
|
||||
.map(|line| line.split_whitespace())
|
||||
.collect();
|
||||
|
||||
std::iter::from_fn(move || {
|
||||
let column: Option<Vec<&str>> = iters
|
||||
.iter_mut()
|
||||
.map(|it| it.next())
|
||||
.collect::<Option<Vec<_>>>();
|
||||
|
||||
let column = column?;
|
||||
|
||||
Some((
|
||||
column[..column.len() - 1].iter().map(|v| v.parse::<u64>().unwrap()).collect::<Vec<_>>(),
|
||||
*column.last().unwrap(),
|
||||
))
|
||||
}).map(|(vals, op)| {
|
||||
match op {
|
||||
"+" => vals.iter().sum::<u64>(),
|
||||
"*" => vals.iter().product::<u64>(),
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}).sum::<u64>()
|
||||
}
|
||||
60
src/day06/part06b.rs
Normal file
60
src/day06/part06b.rs
Normal file
@@ -0,0 +1,60 @@
|
||||
struct ZipAll<I> {
|
||||
iters: Vec<I>,
|
||||
}
|
||||
|
||||
impl<I> Iterator for ZipAll<I>
|
||||
where
|
||||
I: Iterator,
|
||||
{
|
||||
type Item = Vec<I::Item>;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
let mut out = Vec::with_capacity(self.iters.len());
|
||||
|
||||
for it in &mut self.iters {
|
||||
out.push(it.next()?); // return None if any iterator ends
|
||||
}
|
||||
|
||||
Some(out)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
pub fn solve(puzzle: &str) -> u64 {
|
||||
let mut solution: u64 = 0;
|
||||
|
||||
let lines = puzzle
|
||||
.lines()
|
||||
.map(|line| line.chars())
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let mut operator: char = ' ';
|
||||
let mut temp: u64 = 0;
|
||||
ZipAll { iters: lines }
|
||||
.map(|col| {
|
||||
let mut value: u64 = 0;
|
||||
col[..col.len() - 1]
|
||||
.iter()
|
||||
.filter(|c| **c != ' ')
|
||||
.for_each(|c| {value = value * 10 + (*c as u8 - b'0') as u64});
|
||||
(value, *col.last().unwrap())
|
||||
})
|
||||
.for_each(|(value, op)| {
|
||||
if op != ' ' {
|
||||
operator = op;
|
||||
solution += temp;
|
||||
temp = if op == '*' {1} else {0};
|
||||
}
|
||||
if value == 0 { return }
|
||||
match operator {
|
||||
'+' => temp += value,
|
||||
'*' => temp *= value,
|
||||
_ => unreachable!(),
|
||||
}
|
||||
});
|
||||
|
||||
solution + temp
|
||||
}
|
||||
|
||||
|
||||
|
||||
34
src/day07/mod.rs
Normal file
34
src/day07/mod.rs
Normal file
@@ -0,0 +1,34 @@
|
||||
pub mod part07a;
|
||||
pub mod part07b;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::day07::{part07a, part07b};
|
||||
|
||||
const PUZZLE: &str = ".......S.......
|
||||
...............
|
||||
.......^.......
|
||||
...............
|
||||
......^.^......
|
||||
...............
|
||||
.....^.^.^.....
|
||||
...............
|
||||
....^.^...^....
|
||||
...............
|
||||
...^.^...^.^...
|
||||
...............
|
||||
..^...^.....^..
|
||||
...............
|
||||
.^.^.^.^.^...^.
|
||||
...............";
|
||||
|
||||
#[test]
|
||||
fn part07a() {
|
||||
assert_eq!(part07a::solve(PUZZLE), 21);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn part07b() {
|
||||
assert_eq!(part07b::solve(PUZZLE), 40);
|
||||
}
|
||||
}
|
||||
29
src/day07/part07a.rs
Normal file
29
src/day07/part07a.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
pub fn solve(puzzle: &str) -> u64 {
|
||||
let mut solution = 0;
|
||||
let mut lines = puzzle.lines();
|
||||
let mut source = lines
|
||||
.next()
|
||||
.unwrap()
|
||||
.chars()
|
||||
.map(|c| match c { 'S' => 1, _ => 0 } )
|
||||
.collect::<Vec<u8>>();
|
||||
|
||||
lines.for_each(|line| {
|
||||
let mut next_source = source.clone();
|
||||
line.chars().zip(source.iter()).enumerate().for_each(|(i, x)| {
|
||||
match x {
|
||||
('^', 1) => {
|
||||
solution += 1;
|
||||
next_source[i-1] = 1;
|
||||
next_source[i] = 0;
|
||||
next_source[i+1] = 1;
|
||||
},
|
||||
_ => (),
|
||||
}
|
||||
});
|
||||
source = next_source;
|
||||
});
|
||||
|
||||
solution
|
||||
}
|
||||
29
src/day07/part07b.rs
Normal file
29
src/day07/part07b.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
pub fn solve(puzzle: &str) -> u64 {
|
||||
let mut solution = 0;
|
||||
let mut lines = puzzle.lines();
|
||||
let mut source = lines
|
||||
.next()
|
||||
.unwrap()
|
||||
.chars()
|
||||
.map(|c| match c { 'S' => (1, 1), _ => (0, 0) } )
|
||||
.collect::<Vec<(u8, u64)>>();
|
||||
|
||||
lines.for_each(|line| {
|
||||
let mut next_source = source.clone();
|
||||
line.chars().zip(source.iter()).enumerate().for_each(|(i, x)| {
|
||||
match x {
|
||||
('^', (1, weight)) => {
|
||||
solution += weight;
|
||||
next_source[i-1] = (1 , next_source[i-1].1 + weight);
|
||||
next_source[i] = (0, 0);
|
||||
next_source[i+1] = (1 , next_source[i+1].1 + weight)
|
||||
},
|
||||
_ => (),
|
||||
}
|
||||
});
|
||||
source = next_source;
|
||||
});
|
||||
|
||||
solution + 1
|
||||
}
|
||||
40
src/day08/mod.rs
Normal file
40
src/day08/mod.rs
Normal file
@@ -0,0 +1,40 @@
|
||||
pub mod part08a;
|
||||
pub mod part08b;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::day08::{part08a, part08b};
|
||||
|
||||
const PUZZLE: &str = "162,817,812
|
||||
57,618,57
|
||||
906,360,560
|
||||
592,479,940
|
||||
352,342,300
|
||||
466,668,158
|
||||
542,29,236
|
||||
431,825,988
|
||||
739,650,466
|
||||
52,470,668
|
||||
216,146,977
|
||||
819,987,18
|
||||
117,168,530
|
||||
805,96,715
|
||||
346,949,466
|
||||
970,615,88
|
||||
941,993,340
|
||||
862,61,35
|
||||
984,92,344
|
||||
425,690,689";
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn part08a() {
|
||||
assert_eq!(part08a::solve(PUZZLE), 40);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn part08b() {
|
||||
assert_eq!(part08b::solve(PUZZLE), 0);
|
||||
}
|
||||
}
|
||||
4
src/day08/part08a.rs
Normal file
4
src/day08/part08a.rs
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
pub fn solve(puzzle: &str) -> u64 {
|
||||
0 // TODO
|
||||
}
|
||||
4
src/day08/part08b.rs
Normal file
4
src/day08/part08b.rs
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
pub fn solve(puzzle: &str) -> u64 {
|
||||
0 // TODO
|
||||
}
|
||||
27
src/day09/mod.rs
Normal file
27
src/day09/mod.rs
Normal file
@@ -0,0 +1,27 @@
|
||||
pub mod part09a;
|
||||
pub mod part09b;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::day09::{part09a, part09b};
|
||||
|
||||
const PUZZLE: &str = "7,1
|
||||
11,1
|
||||
11,7
|
||||
9,7
|
||||
9,5
|
||||
2,5
|
||||
2,3
|
||||
7,3";
|
||||
|
||||
#[test]
|
||||
fn part09a() {
|
||||
assert_eq!(part09a::solve(PUZZLE), 50);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn part09b() {
|
||||
assert_eq!(part09b::solve(PUZZLE), 24);
|
||||
}
|
||||
}
|
||||
19
src/day09/part09a.rs
Normal file
19
src/day09/part09a.rs
Normal file
@@ -0,0 +1,19 @@
|
||||
use std::ops::Add;
|
||||
|
||||
pub fn solve(puzzle: &str) -> u64 {
|
||||
let mut solution: u64 = 0;
|
||||
|
||||
let points = puzzle
|
||||
.lines()
|
||||
.map(|line| line.split_once(',').unwrap())
|
||||
.map(|(left, right)| (left.parse::<u64>().unwrap(), right.parse::<u64>().unwrap()))
|
||||
.collect::<Vec<(u64, u64)>>();
|
||||
|
||||
points.iter().enumerate().for_each(|(i, point1)| {
|
||||
points.iter().skip(i).for_each(|point2| {
|
||||
solution = solution.max(point1.0.abs_diff(point2.0).add(1) * point1.1.abs_diff(point2.1).add(1));
|
||||
})
|
||||
});
|
||||
|
||||
solution
|
||||
}
|
||||
7
src/day09/part09b.rs
Normal file
7
src/day09/part09b.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
pub fn solve(puzzle: &str) -> u64 {
|
||||
0 // TODO
|
||||
}
|
||||
|
||||
|
||||
|
||||
22
src/day10/mod.rs
Normal file
22
src/day10/mod.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
pub mod part10a;
|
||||
pub mod part10b;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::day10::{part10a, part10b};
|
||||
|
||||
const PUZZLE: &str = "[.##.] (3) (1,3) (2) (2,3) (0,2) (0,1) {3,5,4,7}
|
||||
[...#.] (0,2,3,4) (2,3) (0,4) (0,1,2) (1,2,3,4) {7,5,12,7,2}
|
||||
[.###.#] (0,1,2,3,4) (0,3,4) (0,1,2,4,5) (1,2) {10,11,11,5,10,5}";
|
||||
|
||||
#[test]
|
||||
fn part10a() {
|
||||
assert_eq!(part10a::solve(PUZZLE), 7);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn part10b() {
|
||||
assert_eq!(part10b::solve(PUZZLE), 0);
|
||||
}
|
||||
}
|
||||
72
src/day10/part10a.rs
Normal file
72
src/day10/part10a.rs
Normal file
@@ -0,0 +1,72 @@
|
||||
use std::fmt::Debug;
|
||||
use std::ops::{Add, BitXor};
|
||||
|
||||
fn min_preferring_some<T: Ord>(a: Option<T>, b: Option<T>) -> Option<T> {
|
||||
let r = match (a, b) {
|
||||
(Some(v), None) => Some(v),
|
||||
(None, Some(v)) => Some(v),
|
||||
(Some(v1), Some(v2)) => Some(v1.min(v2)),
|
||||
(None, None) => None,
|
||||
};
|
||||
r
|
||||
}
|
||||
|
||||
fn find_least_combinations<T: BitXor<Output=T> + Eq + Default + Copy>(pre_press: T, buttons: &[T], mut max_depth: usize) -> Option<usize> {
|
||||
if max_depth == 0 {return None}
|
||||
|
||||
let button = buttons.first()?;
|
||||
let post_press = pre_press ^ *button;
|
||||
if post_press == T::default() {
|
||||
return Some(1);
|
||||
}
|
||||
|
||||
let max_pressed = match find_least_combinations(post_press, &buttons[1..], max_depth-1) {
|
||||
Some(v) => {
|
||||
max_depth = v;
|
||||
Some(v+1)
|
||||
},
|
||||
None => None,
|
||||
};
|
||||
if let Some(max) = max_pressed {max_depth = max}
|
||||
|
||||
let max_unpressed = find_least_combinations(pre_press, &buttons[1..], max_depth);
|
||||
min_preferring_some(max_pressed, max_unpressed)
|
||||
}
|
||||
|
||||
pub fn solve(puzzle: &str) -> u64 {
|
||||
puzzle
|
||||
.lines()
|
||||
.map(|line| {
|
||||
let mut chunks = line.split_whitespace();
|
||||
let button_cnt = chunks.clone().count() - 2;
|
||||
(
|
||||
chunks
|
||||
.next()
|
||||
.unwrap()
|
||||
.chars()
|
||||
.filter(|c| c != &'[' && c != &']')
|
||||
.map(|c| match c {
|
||||
'#' => 1,
|
||||
_ => 0
|
||||
})
|
||||
.rev()
|
||||
.reduce(|a, b| a << 1 | b)
|
||||
.unwrap(),
|
||||
chunks
|
||||
.take(button_cnt)
|
||||
.map(|button|
|
||||
button
|
||||
.chars()
|
||||
.filter(|c| c != &'(' && c != &')' && c != &',')
|
||||
.map(|c| c as u8)
|
||||
.map(|c| 1 << (c - b'0'))
|
||||
.map(|c| c as u16)
|
||||
.reduce(|a, b| a | b)
|
||||
.unwrap()
|
||||
)
|
||||
.collect::<Vec<u16>>(),
|
||||
)
|
||||
})
|
||||
.map(|tup| find_least_combinations(tup.0, &tup.1, usize::MAX).unwrap())
|
||||
.sum::<usize>() as u64
|
||||
}
|
||||
4
src/day10/part10b.rs
Normal file
4
src/day10/part10b.rs
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
pub fn solve(puzzle: &str) -> u64 {
|
||||
0 // TODO
|
||||
}
|
||||
66
src/day11/common.rs
Normal file
66
src/day11/common.rs
Normal file
@@ -0,0 +1,66 @@
|
||||
use std::collections::HashMap;
|
||||
use std::fmt;
|
||||
use std::sync::{Arc, Weak};
|
||||
use std::cell::RefCell;
|
||||
|
||||
pub fn parse_node_graph(puzzle: &str) -> HashMap<u32, Arc<RefCell<TreeElement>>> {
|
||||
let mut node_graph = HashMap::new();
|
||||
|
||||
puzzle
|
||||
.lines()
|
||||
.map(|line| line.split_once(':').unwrap())
|
||||
.map(|(node, child_str)| (node.chars().map(|c| c as u32).reduce(|a, b| a << 8 | b).unwrap(), child_str.split_whitespace()))
|
||||
.for_each(|(node, childs)| {
|
||||
let node = node_graph.entry(node).or_insert(Arc::new(RefCell::new(TreeElement::new(node)))).clone();
|
||||
childs.for_each(|child| {
|
||||
let child_id = child.chars().map(|c| c as u32).reduce(|a, b| a << 8 | b).unwrap();
|
||||
let child = node_graph.entry(child_id).or_insert(Arc::new(RefCell::new(TreeElement::new(child_id))));
|
||||
child.borrow_mut().add_parent(&node);
|
||||
node.borrow_mut().add_child(&child);
|
||||
});
|
||||
});
|
||||
|
||||
node_graph
|
||||
}
|
||||
|
||||
pub struct TreeElement {
|
||||
name: u32,
|
||||
parents: Vec<Weak<RefCell<Self>>>,
|
||||
childs: Vec<Weak<RefCell<Self>>>,
|
||||
}
|
||||
|
||||
impl TreeElement {
|
||||
pub fn new(name_hash: u32) -> Self {
|
||||
TreeElement {
|
||||
name: name_hash,
|
||||
parents: Vec::new(),
|
||||
childs: Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_parent(&mut self, parent: &Arc<RefCell<Self>>) {
|
||||
self.parents.push(Arc::downgrade(parent));
|
||||
}
|
||||
|
||||
pub fn add_child(&mut self, child: &Arc<RefCell<Self>>) {
|
||||
self.childs.push(Arc::downgrade(child));
|
||||
}
|
||||
|
||||
pub fn find_route_to_cont(&self, name_hash: u32) -> usize {
|
||||
if name_hash == self.name {
|
||||
return 1;
|
||||
}
|
||||
|
||||
self.childs.iter().map(|child| child.upgrade().unwrap().borrow().find_route_to_cont(name_hash)).sum()
|
||||
}
|
||||
|
||||
pub fn get_name(&self) -> String {
|
||||
format!("{}{}{}", char::from_u32((self.name & 0xFF0000) >> 16).unwrap(), char::from_u32((self.name & 0xFF00) >> 8).unwrap(), char::from_u32((self.name & 0xFF) >> 0).unwrap())
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for TreeElement {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "TreeElement: {} [{:?}] [{:?}]", self.get_name(), self.parents.iter().map(|c| c.upgrade().unwrap().borrow().get_name()).collect::<Vec<_>>(), self.childs.iter().map(|c| c.upgrade().unwrap().borrow().get_name()).collect::<Vec<_>>())
|
||||
}
|
||||
}
|
||||
30
src/day11/mod.rs
Normal file
30
src/day11/mod.rs
Normal file
@@ -0,0 +1,30 @@
|
||||
pub mod part11a;
|
||||
pub mod part11b;
|
||||
mod common;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::day11::{part11a, part11b};
|
||||
|
||||
const PUZZLE: &str = "aaa: you hhh
|
||||
you: bbb ccc
|
||||
bbb: ddd eee
|
||||
ccc: ddd eee fff
|
||||
ddd: ggg
|
||||
eee: out
|
||||
fff: out
|
||||
ggg: out
|
||||
hhh: ccc fff iii
|
||||
iii: out";
|
||||
|
||||
#[test]
|
||||
fn part11a() {
|
||||
assert_eq!(part11a::solve(PUZZLE), 5);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn part11b() {
|
||||
assert_eq!(part11b::solve(PUZZLE), 0);
|
||||
}
|
||||
}
|
||||
8
src/day11/part11a.rs
Normal file
8
src/day11/part11a.rs
Normal file
@@ -0,0 +1,8 @@
|
||||
use crate::day11::common::{parse_node_graph};
|
||||
|
||||
|
||||
pub fn solve(puzzle: &str) -> u64 {
|
||||
let node_graph = parse_node_graph(&puzzle);
|
||||
|
||||
node_graph.get(&"you".chars().map(|c| c as u32).reduce(|a, b| a << 8 | b).unwrap()).unwrap().borrow().find_route_to_cont("out".chars().map(|c| c as u32).reduce(|a, b| a << 8 | b).unwrap()) as u64
|
||||
}
|
||||
9
src/day11/part11b.rs
Normal file
9
src/day11/part11b.rs
Normal file
@@ -0,0 +1,9 @@
|
||||
use crate::day11::common::{parse_node_graph};
|
||||
|
||||
|
||||
pub fn solve(puzzle: &str) -> u64 {
|
||||
let node_graph = parse_node_graph(&puzzle);
|
||||
|
||||
node_graph.get(&"you".chars().map(|c| c as u32).reduce(|a, b| a << 8 | b).unwrap()).unwrap().borrow().find_route_to_cont("out".chars().map(|c| c as u32).reduce(|a, b| a << 8 | b).unwrap()) as u64
|
||||
|
||||
}
|
||||
55
src/main.rs
55
src/main.rs
@@ -1,12 +1,18 @@
|
||||
use day01::{part01a, part01b};
|
||||
use day02::{part02a, part02b};
|
||||
use day03::{part03a, part03b};
|
||||
use day04::{part04a, part04b};
|
||||
use std::fmt::format;
|
||||
mod day01;
|
||||
mod day02;
|
||||
mod day03;
|
||||
mod day04;
|
||||
mod day05;
|
||||
mod day06;
|
||||
mod day07;
|
||||
mod day08;
|
||||
mod day09;
|
||||
mod day10;
|
||||
mod day11;
|
||||
|
||||
use std::time::Instant;
|
||||
|
||||
use std::fs::OpenOptions;
|
||||
use std::io::Result;
|
||||
use std::io::Write;
|
||||
|
||||
fn main() {
|
||||
@@ -20,24 +26,39 @@ fn main() {
|
||||
file.write_all(b"# Advent of Code 2025\n```bash\n")
|
||||
.expect("Cannot write to file");
|
||||
|
||||
let exercises: Vec<(&str, fn() -> u64)> = vec![
|
||||
("day01:A", part01a::solve),
|
||||
("day01:B", part01b::solve),
|
||||
("day02:A", part02a::solve),
|
||||
("day02:B", part02b::solve),
|
||||
("day03:A", part03a::solve),
|
||||
("day03:B", part03b::solve),
|
||||
("day04:A", part04a::solve),
|
||||
("day04:B", part04b::solve),
|
||||
let exercises: Vec<(&str, fn(&str) -> u64, &str)> = vec![
|
||||
("day01:A", day01::part01a::solve, "puzzles/input01.txt"),
|
||||
("day01:B", day01::part01b::solve, "puzzles/input01.txt"),
|
||||
("day02:A", day02::part02a::solve, "puzzles/input02.txt"),
|
||||
("day02:B", day02::part02b::solve, "puzzles/input02.txt"),
|
||||
("day03:A", day03::part03a::solve, "puzzles/input03.txt"),
|
||||
("day03:B", day03::part03b::solve, "puzzles/input03.txt"),
|
||||
("day04:A", day04::part04a::solve, "puzzles/input04.txt"),
|
||||
("day04:B", day04::part04b::solve, "puzzles/input04.txt"),
|
||||
("day05:A", day05::part05a::solve, "puzzles/input05.txt"),
|
||||
("day05:B", day05::part05b::solve, "puzzles/input05.txt"),
|
||||
("day06:A", day06::part06a::solve, "puzzles/input06.txt"),
|
||||
("day06:B", day06::part06b::solve, "puzzles/input06.txt"),
|
||||
("day07:A", day07::part07a::solve, "puzzles/input07.txt"),
|
||||
("day07:B", day07::part07b::solve, "puzzles/input07.txt"),
|
||||
("day08:A", day08::part08a::solve, "puzzles/input08.txt"),
|
||||
("day08:B", day08::part08b::solve, "puzzles/input08.txt"),
|
||||
("day09:A", day09::part09a::solve, "puzzles/input09.txt"),
|
||||
("day09:B", day09::part09b::solve, "puzzles/input09.txt"),
|
||||
("day10:A", day10::part10a::solve, "puzzles/input10.txt"),
|
||||
("day10:B", day10::part10b::solve, "puzzles/input10.txt"),
|
||||
("day11:A", day11::part11a::solve, "puzzles/input11.txt"),
|
||||
("day11:B", day11::part11b::solve, "puzzles/input11.txt"),
|
||||
];
|
||||
|
||||
let start: Instant = Instant::now();
|
||||
exercises.iter().for_each(|(day, func)| {
|
||||
exercises.iter().for_each(|(day, func, filename)| {
|
||||
let file_content = std::fs::read_to_string(filename).expect("Cannot read file");
|
||||
let day_start: Instant = Instant::now();
|
||||
let solution = format!(
|
||||
"{:7} => {:15} ({:6}us)\n",
|
||||
day,
|
||||
func(),
|
||||
func(&file_content),
|
||||
day_start.elapsed().as_micros()
|
||||
);
|
||||
print!("{}", solution);
|
||||
|
||||
41
story/story04a.txt
Normal file
41
story/story04a.txt
Normal file
@@ -0,0 +1,41 @@
|
||||
--- Day 4: Printing Department ---
|
||||
|
||||
You ride the escalator down to the printing department. They're clearly getting ready for Christmas; they have lots of large rolls of paper everywhere, and there's even a massive printer in the corner (to handle the really big print jobs).
|
||||
|
||||
Decorating here will be easy: they can make their own decorations. What you really need is a way to get further into the North Pole base while the elevators are offline.
|
||||
|
||||
"Actually, maybe we can help with that," one of the Elves replies when you ask for help. "We're pretty sure there's a cafeteria on the other side of the back wall. If we could break through the wall, you'd be able to keep moving. It's too bad all of our forklifts are so busy moving those big rolls of paper around."
|
||||
|
||||
If you can optimize the work the forklifts are doing, maybe they would have time to spare to break through the wall.
|
||||
|
||||
The rolls of paper (@) are arranged on a large grid; the Elves even have a helpful diagram (your puzzle input) indicating where everything is located.
|
||||
|
||||
For example:
|
||||
|
||||
..@@.@@@@.
|
||||
@@@.@.@.@@
|
||||
@@@@@.@.@@
|
||||
@.@@@@..@.
|
||||
@@.@@@@.@@
|
||||
.@@@@@@@.@
|
||||
.@.@.@.@@@
|
||||
@.@@@.@@@@
|
||||
.@@@@@@@@.
|
||||
@.@.@@@.@.
|
||||
|
||||
The forklifts can only access a roll of paper if there are fewer than four rolls of paper in the eight adjacent positions. If you can figure out which rolls of paper the forklifts can access, they'll spend less time looking and more time breaking down the wall to the cafeteria.
|
||||
|
||||
In this example, there are 13 rolls of paper that can be accessed by a forklift (marked with x):
|
||||
|
||||
..xx.xx@x.
|
||||
x@@.@.@.@@
|
||||
@@@@@.x.@@
|
||||
@.@@@@..@.
|
||||
x@.@@@@.@x
|
||||
.@@@@@@@.@
|
||||
.@.@.@.@@@
|
||||
x.@@@.@@@@
|
||||
.@@@@@@@@.
|
||||
x.x.@@@.x.
|
||||
|
||||
Consider your complete diagram of the paper roll locations. How many rolls of paper can be accessed by a forklift?
|
||||
131
story/story04b.txt
Normal file
131
story/story04b.txt
Normal file
@@ -0,0 +1,131 @@
|
||||
--- Part Two ---
|
||||
|
||||
Now, the Elves just need help accessing as much of the paper as they can.
|
||||
|
||||
Once a roll of paper can be accessed by a forklift, it can be removed. Once a roll of paper is removed, the forklifts might be able to access more rolls of paper, which they might also be able to remove. How many total rolls of paper could the Elves remove if they keep repeating this process?
|
||||
|
||||
Starting with the same example as above, here is one way you could remove as many rolls of paper as possible, using highlighted @ to indicate that a roll of paper is about to be removed, and using x to indicate that a roll of paper was just removed:
|
||||
|
||||
Initial state:
|
||||
..@@.@@@@.
|
||||
@@@.@.@.@@
|
||||
@@@@@.@.@@
|
||||
@.@@@@..@.
|
||||
@@.@@@@.@@
|
||||
.@@@@@@@.@
|
||||
.@.@.@.@@@
|
||||
@.@@@.@@@@
|
||||
.@@@@@@@@.
|
||||
@.@.@@@.@.
|
||||
|
||||
Remove 13 rolls of paper:
|
||||
..xx.xx@x.
|
||||
x@@.@.@.@@
|
||||
@@@@@.x.@@
|
||||
@.@@@@..@.
|
||||
x@.@@@@.@x
|
||||
.@@@@@@@.@
|
||||
.@.@.@.@@@
|
||||
x.@@@.@@@@
|
||||
.@@@@@@@@.
|
||||
x.x.@@@.x.
|
||||
|
||||
Remove 12 rolls of paper:
|
||||
.......x..
|
||||
.@@.x.x.@x
|
||||
x@@@@...@@
|
||||
x.@@@@..x.
|
||||
.@.@@@@.x.
|
||||
.x@@@@@@.x
|
||||
.x.@.@.@@@
|
||||
..@@@.@@@@
|
||||
.x@@@@@@@.
|
||||
....@@@...
|
||||
|
||||
Remove 7 rolls of paper:
|
||||
..........
|
||||
.x@.....x.
|
||||
.@@@@...xx
|
||||
..@@@@....
|
||||
.x.@@@@...
|
||||
..@@@@@@..
|
||||
...@.@.@@x
|
||||
..@@@.@@@@
|
||||
..x@@@@@@.
|
||||
....@@@...
|
||||
|
||||
Remove 5 rolls of paper:
|
||||
..........
|
||||
..x.......
|
||||
.x@@@.....
|
||||
..@@@@....
|
||||
...@@@@...
|
||||
..x@@@@@..
|
||||
...@.@.@@.
|
||||
..x@@.@@@x
|
||||
...@@@@@@.
|
||||
....@@@...
|
||||
|
||||
Remove 2 rolls of paper:
|
||||
..........
|
||||
..........
|
||||
..x@@.....
|
||||
..@@@@....
|
||||
...@@@@...
|
||||
...@@@@@..
|
||||
...@.@.@@.
|
||||
...@@.@@@.
|
||||
...@@@@@x.
|
||||
....@@@...
|
||||
|
||||
Remove 1 roll of paper:
|
||||
..........
|
||||
..........
|
||||
...@@.....
|
||||
..x@@@....
|
||||
...@@@@...
|
||||
...@@@@@..
|
||||
...@.@.@@.
|
||||
...@@.@@@.
|
||||
...@@@@@..
|
||||
....@@@...
|
||||
|
||||
Remove 1 roll of paper:
|
||||
..........
|
||||
..........
|
||||
...x@.....
|
||||
...@@@....
|
||||
...@@@@...
|
||||
...@@@@@..
|
||||
...@.@.@@.
|
||||
...@@.@@@.
|
||||
...@@@@@..
|
||||
....@@@...
|
||||
|
||||
Remove 1 roll of paper:
|
||||
..........
|
||||
..........
|
||||
....x.....
|
||||
...@@@....
|
||||
...@@@@...
|
||||
...@@@@@..
|
||||
...@.@.@@.
|
||||
...@@.@@@.
|
||||
...@@@@@..
|
||||
....@@@...
|
||||
|
||||
Remove 1 roll of paper:
|
||||
..........
|
||||
..........
|
||||
..........
|
||||
...x@@....
|
||||
...@@@@...
|
||||
...@@@@@..
|
||||
...@.@.@@.
|
||||
...@@.@@@.
|
||||
...@@@@@..
|
||||
....@@@...
|
||||
|
||||
Stop once no more rolls of paper are accessible by a forklift. In this example, a total of 43 rolls of paper can be removed.
|
||||
|
||||
Start with your original diagram. How many rolls of paper in total can be removed by the Elves and their forklifts?
|
||||
38
story/story05a.txt
Normal file
38
story/story05a.txt
Normal file
@@ -0,0 +1,38 @@
|
||||
--- Day 5: Cafeteria ---
|
||||
|
||||
As the forklifts break through the wall, the Elves are delighted to discover that there was a cafeteria on the other side after all.
|
||||
|
||||
You can hear a commotion coming from the kitchen. "At this rate, we won't have any time left to put the wreaths up in the dining hall!" Resolute in your quest, you investigate.
|
||||
|
||||
"If only we hadn't switched to the new inventory management system right before Christmas!" another Elf exclaims. You ask what's going on.
|
||||
|
||||
The Elves in the kitchen explain the situation: because of their complicated new inventory management system, they can't figure out which of their ingredients are fresh and which are spoiled. When you ask how it works, they give you a copy of their database (your puzzle input).
|
||||
|
||||
The database operates on ingredient IDs. It consists of a list of fresh ingredient ID ranges, a blank line, and a list of available ingredient IDs. For example:
|
||||
|
||||
3-5
|
||||
10-14
|
||||
16-20
|
||||
12-18
|
||||
|
||||
1
|
||||
5
|
||||
8
|
||||
11
|
||||
17
|
||||
32
|
||||
|
||||
The fresh ID ranges are inclusive: the range 3-5 means that ingredient IDs 3, 4, and 5 are all fresh. The ranges can also overlap; an ingredient ID is fresh if it is in any range.
|
||||
|
||||
The Elves are trying to determine which of the available ingredient IDs are fresh. In this example, this is done as follows:
|
||||
|
||||
Ingredient ID 1 is spoiled because it does not fall into any range.
|
||||
Ingredient ID 5 is fresh because it falls into range 3-5.
|
||||
Ingredient ID 8 is spoiled.
|
||||
Ingredient ID 11 is fresh because it falls into range 10-14.
|
||||
Ingredient ID 17 is fresh because it falls into range 16-20 as well as range 12-18.
|
||||
Ingredient ID 32 is spoiled.
|
||||
|
||||
So, in this example, 3 of the available ingredient IDs are fresh.
|
||||
|
||||
Process the database file from the new inventory management system. How many of the available ingredient IDs are fresh?
|
||||
16
story/story05b.txt
Normal file
16
story/story05b.txt
Normal file
@@ -0,0 +1,16 @@
|
||||
--- Part Two ---
|
||||
|
||||
The Elves start bringing their spoiled inventory to the trash chute at the back of the kitchen.
|
||||
|
||||
So that they can stop bugging you when they get new inventory, the Elves would like to know all of the IDs that the fresh ingredient ID ranges consider to be fresh. An ingredient ID is still considered fresh if it is in any range.
|
||||
|
||||
Now, the second section of the database (the available ingredient IDs) is irrelevant. Here are the fresh ingredient ID ranges from the above example:
|
||||
|
||||
3-5
|
||||
10-14
|
||||
16-20
|
||||
12-18
|
||||
|
||||
The ingredient IDs that these ranges consider to be fresh are 3, 4, 5, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, and 20. So, in this example, the fresh ingredient ID ranges consider a total of 14 ingredient IDs to be fresh.
|
||||
|
||||
Process the database file again. How many ingredient IDs are considered to be fresh according to the fresh ingredient ID ranges?
|
||||
0
story/story06a.txt
Normal file
0
story/story06a.txt
Normal file
0
story/story06b.txt
Normal file
0
story/story06b.txt
Normal file
0
story/story09a.txt
Normal file
0
story/story09a.txt
Normal file
0
story/story09b.txt
Normal file
0
story/story09b.txt
Normal file
Reference in New Issue
Block a user