From 361428fe9a351421dead30b8214360134863ada7 Mon Sep 17 00:00:00 2001 From: Manuel Meraz Date: Tue, 10 Jan 2017 13:10:07 -0800 Subject: [PATCH 01/10] new test --- challenge_7/README.md | 14 +++++++++++++- challenge_7/testfiles/o1 | 1 + challenge_7/testfiles/o2 | 1 + challenge_7/testfiles/o3 | 1 + challenge_7/testfiles/o4 | 1 + challenge_7/testfiles/o5 | 1 + challenge_7/testfiles/t1 | 1 + challenge_7/testfiles/t2 | 1 + challenge_7/testfiles/t3 | 1 + challenge_7/testfiles/t4 | 1 + challenge_7/testfiles/t5 | 1 + 11 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 challenge_7/testfiles/o1 create mode 100644 challenge_7/testfiles/o2 create mode 100644 challenge_7/testfiles/o3 create mode 100644 challenge_7/testfiles/o4 create mode 100644 challenge_7/testfiles/o5 create mode 100644 challenge_7/testfiles/t1 create mode 100644 challenge_7/testfiles/t2 create mode 100644 challenge_7/testfiles/t3 create mode 100644 challenge_7/testfiles/t4 create mode 100644 challenge_7/testfiles/t5 diff --git a/challenge_7/README.md b/challenge_7/README.md index ca739981b..cfb49b0b8 100644 --- a/challenge_7/README.md +++ b/challenge_7/README.md @@ -33,7 +33,7 @@ Example 2 --------- Given the list [1,2,3], your program should return the 0. -Testing +[Testing](https://github.com/YearOfProgramming/2017Challenges#testing) ------ Testing for this challenge is fairly straight forward. Simply create a list of size N, filled with integers from 0 to N, with one integer missing. @@ -43,3 +43,15 @@ For example: ```ruby assert findMissing([1,3,4,0]) == 2 ``` + +######Test script requirements + +Expected input: + + 1,3,4,0 + +Expected output: + + 2 + + diff --git a/challenge_7/testfiles/o1 b/challenge_7/testfiles/o1 new file mode 100644 index 000000000..0cfbf0888 --- /dev/null +++ b/challenge_7/testfiles/o1 @@ -0,0 +1 @@ +2 diff --git a/challenge_7/testfiles/o2 b/challenge_7/testfiles/o2 new file mode 100644 index 000000000..257e56326 --- /dev/null +++ b/challenge_7/testfiles/o2 @@ -0,0 +1 @@ +102 diff --git a/challenge_7/testfiles/o3 b/challenge_7/testfiles/o3 new file mode 100644 index 000000000..1ce6b02d7 --- /dev/null +++ b/challenge_7/testfiles/o3 @@ -0,0 +1 @@ +339 diff --git a/challenge_7/testfiles/o4 b/challenge_7/testfiles/o4 new file mode 100644 index 000000000..9559cd924 --- /dev/null +++ b/challenge_7/testfiles/o4 @@ -0,0 +1 @@ +730 diff --git a/challenge_7/testfiles/o5 b/challenge_7/testfiles/o5 new file mode 100644 index 000000000..e5a135a53 --- /dev/null +++ b/challenge_7/testfiles/o5 @@ -0,0 +1 @@ +445 diff --git a/challenge_7/testfiles/t1 b/challenge_7/testfiles/t1 new file mode 100644 index 000000000..314e469fb --- /dev/null +++ b/challenge_7/testfiles/t1 @@ -0,0 +1 @@ +1,3,4,0 diff --git a/challenge_7/testfiles/t2 b/challenge_7/testfiles/t2 new file mode 100644 index 000000000..92464eddf --- /dev/null +++ b/challenge_7/testfiles/t2 @@ -0,0 +1 @@ +93, 98, 202, 561, 591, 311, 428, 180, 590, 62, 265, 333, 310, 439, 519, 438, 924, 610, 866, 774, 173, 167, 667, 910, 460, 555, 245, 586, 278, 28, 963, 61, 87, 719, 94, 38, 503, 454, 163, 250, 638, 57, 412, 865, 274, 334, 433, 353, 825, 342, 858, 909, 320, 650, 2, 13, 761, 221, 53, 117, 662, 664, 126, 414, 154, 388, 322, 768, 851, 801, 264, 799, 656, 181, 213, 887, 641, 59, 272, 970, 538, 104, 998, 445, 800, 347, 355, 540, 115, 783, 302, 52, 822, 570, 103, 512, 96, 660, 578, 694, 400, 49, 842, 81, 772, 972, 266, 870, 670, 340, 34, 932, 135, 189, 592, 339, 306, 501, 708, 706, 798, 294, 537, 371, 647, 935, 246, 418, 36, 933, 116, 652, 270, 654, 581, 348, 481, 547, 867, 463, 328, 786, 676, 495, 881, 497, 364, 675, 817, 721, 155, 247, 174, 758, 299, 698, 612, 498, 516, 15, 44, 313, 917, 429, 205, 475, 381, 8, 752, 111, 579, 615, 288, 241, 550, 120, 724, 106, 218, 239, 905, 19, 70, 72, 839, 711, 261, 368, 515, 773, 746, 645, 981, 369, 780, 393, 636, 539, 626, 405, 282, 877, 992, 424, 290, 691, 980, 898, 457, 567, 284, 613, 737, 960, 145, 571, 595, 743, 782, 683, 331, 559, 836, 747, 813, 372, 358, 343, 712, 755, 450, 947, 403, 197, 587, 901, 374, 603, 988, 816, 994, 473, 855, 192, 415, 291, 897, 370, 600, 598, 502, 750, 51, 982, 190, 222, 857, 582, 32, 201, 494, 165, 409, 681, 105, 771, 666, 427, 508, 214, 672, 640, 455, 633, 802, 658, 936, 568, 604, 619, 643, 766, 533, 307, 805, 344, 700, 54, 631, 788, 251, 373, 759, 41, 945, 779, 741, 480, 301, 389, 26, 830, 477, 276, 35, 469, 689, 292, 39, 684, 378, 490, 589, 491, 680, 382, 985, 703, 639, 993, 273, 224, 208, 206, 807, 916, 921, 85, 71, 349, 781, 242, 716, 432, 524, 286, 228, 257, 55, 362, 713, 943, 95, 989, 23, 554, 33, 535, 880, 514, 83, 608, 113, 891, 853, 513, 207, 565, 692, 990, 622, 448, 47, 532, 179, 101, 968, 440, 618, 161, 304, 655, 526, 268, 722, 682, 556, 704, 262, 325, 864, 551, 285, 808, 762, 12, 25, 748, 390, 196, 289, 931, 534, 678, 869, 255, 75, 89, 562, 946, 78, 661, 420, 29, 226, 911, 965, 256, 147, 860, 740, 882, 701, 258, 697, 437, 956, 594, 673, 449, 30, 176, 930, 847, 955, 21, 316, 444, 337, 164, 119, 584, 657, 110, 714, 838, 92, 219, 346, 776, 191, 296, 472, 778, 447, 530, 922, 546, 777, 125, 585, 844, 529, 361, 4, 283, 410, 18, 775, 849, 545, 861, 795, 27, 785, 971, 812, 528, 767, 269, 233, 426, 605, 295, 160, 327, 878, 280, 856, 476, 229, 170, 431, 360, 277, 809, 305, 791, 3, 687, 178, 150, 97, 536, 558, 124, 967, 86, 129, 379, 671, 892, 793, 465, 720, 984, 123, 635, 646, 297, 872, 383, 679, 332, 699, 577, 729, 723, 871, 308, 464, 811, 88, 958, 7, 544, 950, 142, 215, 375, 484, 962, 896, 336, 182, 394, 607, 232, 376, 398, 952, 978, 552, 765, 574, 330, 323, 756, 728, 243, 184, 583, 317, 249, 17, 940, 938, 329, 259, 404, 885, 356, 127, 823, 717, 223, 168, 56, 446, 212, 319, 760, 899, 82, 422, 833, 187, 248, 458, 118, 40, 350, 293, 841, 275, 900, 509, 888, 944, 523, 244, 754, 351, 941, 198, 903, 149, 996, 499, 908, 60, 417, 384, 510, 466, 942, 134, 744, 14, 65, 386, 5, 203, 68, 576, 43, 399, 146, 726, 253, 335, 505, 456, 806, 79, 209, 10, 541, 991, 874, 240, 271, 824, 326, 770, 792, 875, 553, 718, 789, 852, 629, 837, 137, 790, 254, 133, 939, 359, 563, 621, 46, 826, 11, 185, 443, 377, 130, 732, 121, 763, 954, 138, 298, 757, 893, 441, 828, 483, 749, 548, 879, 731, 923, 937, 975, 934, 883, 735, 152, 64, 751, 959, 148, 797, 300, 435, 707, 210, 406, 468, 84, 846, 67, 521, 614, 983, 564, 140, 835, 850, 416, 122, 99, 171, 733, 425, 895, 995, 764, 488, 593, 688, 413, 520, 525, 63, 693, 471, 107, 500, 829, 974, 913, 216, 794, 442, 231, 542, 474, 572, 162, 109, 685, 279, 742, 868, 862, 357, 80, 459, 90, 569, 979, 156, 74, 820, 354, 487, 235, 452, 787, 48, 177, 710, 715, 341, 665, 486, 734, 617, 834, 588, 391, 204, 42, 784, 796, 769, 419, 252, 876, 915, 531, 1000, 193, 637, 345, 653, 462, 482, 100, 669, 467, 58, 620, 493, 397, 738, 227, 573, 580, 436, 843, 624, 131, 642, 918, 725, 606, 37, 527, 45, 999, 511, 599, 132, 902, 73, 200, 453, 24, 611, 854, 627, 695, 925, 169, 220, 949, 211, 560, 492, 804, 401, 690, 144, 926, 961, 904, 434, 648, 281, 470, 158, 727, 367, 172, 395, 803, 927, 819, 630, 884, 69, 966, 912, 363, 314, 402, 387, 845, 575, 230, 318, 396, 315, 22, 948, 886, 407, 506, 977, 953, 906, 479, 815, 651, 894, 920, 814, 217, 183, 507, 518, 951, 686, 139, 928, 461, 128, 411, 237, 151, 702, 267, 238, 848, 321, 108, 709, 504, 236, 649, 889, 859, 696, 597, 91, 736, 234, 112, 907, 831, 496, 623, 114, 312, 914, 136, 517, 602, 986, 632, 596, 663, 186, 392, 287, 745, 522, 6, 303, 76, 969, 478, 77, 225, 260, 188, 601, 634, 668, 175, 143, 677, 157, 352, 141, 365, 543, 263, 199, 609, 16, 628, 753, 957, 9, 338, 66, 31, 557, 873, 616, 987, 489, 50, 821, 625, 810, 366, 309, 194, 674, 919, 964, 890, 153, 159, 929, 1, 705, 827, 566, 324, 451, 973, 380, 997, 644, 485, 20, 430, 659, 739, 421, 549, 408, 730, 166, 818, 195, 840, 385, 863, 832, 976, 423 diff --git a/challenge_7/testfiles/t3 b/challenge_7/testfiles/t3 new file mode 100644 index 000000000..9621e426b --- /dev/null +++ b/challenge_7/testfiles/t3 @@ -0,0 +1 @@ +128, 636, 454, 771, 163, 638, 574, 41, 300, 708, 589, 373, 868, 803, 973, 745, 393, 876, 651, 328, 596, 137, 31, 383, 892, 812, 415, 332, 577, 681, 767, 225, 566, 546, 289, 981, 627, 178, 675, 672, 724, 558, 858, 690, 968, 663, 310, 855, 621, 614, 831, 236, 235, 944, 880, 673, 354, 319, 69, 715, 962, 298, 657, 778, 660, 212, 333, 709, 254, 223, 241, 43, 817, 814, 619, 674, 78, 325, 119, 507, 753, 604, 75, 579, 793, 61, 755, 397, 312, 315, 859, 176, 353, 595, 438, 251, 923, 887, 960, 85, 712, 30, 798, 39, 97, 863, 451, 555, 346, 44, 113, 280, 551, 389, 843, 957, 480, 554, 469, 426, 591, 411, 228, 511, 629, 66, 827, 628, 106, 644, 693, 758, 637, 52, 937, 518, 922, 665, 677, 526, 562, 785, 214, 471, 249, 157, 1000, 27, 578, 701, 666, 795, 654, 476, 35, 943, 664, 599, 655, 281, 749, 292, 138, 754, 267, 575, 610, 630, 122, 694, 49, 941, 77, 857, 17, 387, 392, 533, 420, 700, 195, 179, 352, 433, 40, 794, 760, 80, 103, 622, 409, 87, 207, 81, 132, 743, 162, 215, 721, 473, 68, 115, 348, 563, 74, 641, 580, 155, 951, 220, 989, 418, 748, 394, 293, 779, 598, 187, 764, 136, 544, 199, 603, 966, 906, 360, 374, 719, 459, 510, 975, 252, 494, 632, 193, 553, 18, 219, 175, 456, 929, 84, 691, 302, 314, 741, 584, 615, 444, 601, 323, 282, 64, 877, 11, 255, 144, 890, 763, 921, 506, 832, 911, 623, 978, 76, 792, 999, 307, 662, 838, 372, 271, 477, 739, 404, 26, 525, 110, 296, 909, 826, 602, 873, 613, 475, 974, 704, 361, 573, 539, 295, 208, 326, 509, 206, 501, 59, 987, 811, 442, 127, 340, 105, 770, 649, 993, 390, 86, 183, 731, 446, 585, 907, 692, 309, 205, 261, 95, 898, 686, 894, 22, 658, 266, 992, 872, 129, 925, 98, 294, 23, 864, 90, 453, 576, 83, 490, 919, 783, 643, 34, 498, 117, 131, 829, 88, 461, 905, 607, 231, 188, 285, 194, 21, 445, 108, 375, 308, 685, 441, 337, 107, 148, 492, 822, 805, 884, 211, 722, 738, 797, 653, 417, 316, 210, 62, 816, 671, 836, 774, 980, 227, 984, 434, 543, 239, 904, 150, 684, 134, 168, 504, 568, 413, 972, 427, 422, 587, 156, 790, 479, 248, 264, 450, 728, 901, 697, 844, 696, 718, 698, 924, 365, 238, 167, 821, 590, 582, 170, 787, 412, 464, 465, 608, 516, 931, 329, 950, 762, 734, 184, 356, 257, 870, 435, 141, 47, 25, 474, 634, 368, 234, 9, 954, 705, 756, 571, 191, 725, 508, 343, 38, 159, 10, 699, 878, 313, 349, 395, 320, 13, 706, 810, 273, 381, 463, 788, 593, 670, 58, 889, 363, 448, 355, 958, 224, 428, 4, 639, 94, 528, 135, 416, 8, 977, 860, 283, 174, 825, 278, 488, 237, 79, 900, 703, 946, 382, 458, 959, 99, 586, 486, 502, 600, 819, 247, 802, 799, 57, 401, 996, 757, 126, 815, 882, 899, 818, 56, 854, 452, 716, 963, 529, 242, 274, 229, 940, 540, 520, 515, 114, 626, 895, 569, 16, 303, 971, 327, 625, 192, 478, 841, 519, 481, 334, 581, 250, 423, 118, 856, 765, 559, 530, 786, 552, 288, 145, 970, 204, 936, 466, 514, 914, 885, 503, 640, 405, 344, 824, 149, 152, 109, 233, 983, 116, 111, 161, 364, 260, 594, 740, 549, 867, 151, 945, 532, 744, 166, 447, 29, 269, 661, 350, 597, 198, 875, 656, 200, 617, 385, 809, 359, 321, 245, 723, 956, 534, 648, 28, 402, 935, 324, 142, 967, 730, 12, 733, 32, 272, 357, 244, 499, 268, 301, 695, 263, 378, 100, 489, 897, 933, 707, 548, 522, 891, 14, 560, 646, 336, 583, 362, 297, 776, 611, 759, 487, 338, 545, 952, 177, 605, 995, 305, 379, 91, 982, 386, 275, 547, 286, 830, 871, 342, 462, 642, 976, 717, 979, 834, 942, 101, 513, 197, 847, 866, 376, 620, 969, 366, 377, 318, 961, 679, 848, 688, 736, 449, 726, 82, 380, 561, 635, 683, 702, 190, 495, 2, 927, 71, 550, 51, 631, 496, 121, 276, 588, 455, 33, 947, 505, 217, 398, 773, 606, 182, 67, 955, 143, 185, 918, 124, 133, 287, 850, 851, 938, 652, 139, 424, 367, 54, 60, 347, 840, 839, 714, 371, 800, 737, 258, 203, 645, 915, 73, 994, 246, 370, 399, 965, 265, 436, 104, 226, 852, 153, 304, 732, 256, 470, 557, 853, 403, 216, 813, 678, 485, 669, 172, 990, 484, 408, 102, 556, 406, 93, 483, 230, 421, 680, 5, 112, 835, 6, 953, 196, 570, 388, 537, 542, 468, 784, 186, 284, 916, 384, 808, 879, 221, 330, 780, 567, 926, 667, 751, 912, 158, 432, 48, 414, 536, 430, 865, 72, 747, 893, 351, 849, 727, 908, 775, 592, 729, 20, 997, 202, 345, 777, 531, 120, 512, 437, 837, 55, 902, 659, 523, 934, 949, 439, 171, 222, 140, 948, 711, 218, 154, 517, 419, 920, 19, 240, 279, 45, 874, 564, 491, 331, 846, 572, 917, 1, 37, 761, 633, 50, 881, 457, 232, 123, 467, 181, 24, 789, 130, 928, 443, 259, 986, 146, 535, 369, 322, 913, 612, 189, 782, 42, 173, 689, 425, 710, 998, 930, 650, 429, 820, 616, 7, 713, 270, 903, 735, 440, 687, 791, 769, 472, 527, 3, 618, 96, 500, 410, 766, 886, 796, 910, 15, 89, 720, 524, 565, 932, 290, 768, 299, 742, 823, 253, 53, 46, 306, 482, 676, 647, 396, 209, 213, 801, 317, 493, 781, 888, 521, 125, 964, 842, 341, 70, 277, 807, 861, 311, 772, 160, 682, 985, 335, 869, 201, 262, 862, 896, 624, 243, 668, 169, 541, 828, 431, 609, 752, 804, 806, 991, 65, 746, 833, 883, 164, 750, 460, 538, 291, 358, 180, 497, 400, 36, 147, 391, 165, 407, 92, 939, 63, 988, 845 diff --git a/challenge_7/testfiles/t4 b/challenge_7/testfiles/t4 new file mode 100644 index 000000000..11f0eb556 --- /dev/null +++ b/challenge_7/testfiles/t4 @@ -0,0 +1 @@ +147, 495, 24, 743, 876, 592, 558, 841, 782, 852, 528, 505, 878, 261, 734, 396, 660, 870, 550, 13, 449, 732, 672, 29, 470, 507, 246, 222, 801, 455, 586, 11, 205, 88, 98, 938, 964, 433, 953, 275, 699, 113, 199, 862, 960, 483, 119, 382, 208, 7, 456, 701, 666, 308, 808, 96, 485, 927, 157, 762, 677, 696, 557, 991, 20, 447, 459, 705, 893, 986, 747, 565, 172, 894, 693, 511, 467, 970, 622, 178, 915, 419, 670, 364, 512, 365, 896, 628, 95, 561, 496, 833, 825, 66, 887, 589, 934, 713, 443, 134, 154, 514, 302, 857, 949, 257, 571, 368, 26, 367, 937, 35, 883, 926, 418, 593, 156, 307, 591, 282, 846, 371, 903, 829, 313, 735, 868, 577, 859, 804, 84, 262, 579, 174, 948, 566, 309, 466, 621, 845, 390, 30, 715, 820, 785, 604, 924, 619, 611, 866, 166, 336, 680, 201, 772, 605, 193, 534, 539, 867, 984, 500, 955, 244, 142, 835, 301, 727, 168, 355, 598, 850, 342, 578, 385, 920, 197, 360, 590, 48, 570, 731, 783, 401, 245, 211, 37, 612, 513, 906, 649, 16, 194, 886, 198, 209, 458, 457, 515, 631, 297, 100, 362, 32, 155, 274, 300, 379, 86, 935, 563, 114, 714, 83, 320, 637, 815, 374, 717, 958, 918, 268, 975, 741, 508, 417, 599, 995, 75, 941, 36, 769, 103, 615, 228, 909, 524, 569, 745, 884, 864, 885, 163, 239, 231, 132, 71, 9, 760, 288, 498, 295, 817, 143, 794, 325, 476, 403, 253, 600, 240, 985, 361, 767, 158, 293, 774, 74, 345, 657, 668, 10, 102, 799, 76, 640, 492, 773, 252, 523, 994, 180, 776, 976, 80, 576, 330, 871, 129, 952, 341, 429, 544, 607, 6, 89, 875, 494, 414, 968, 195, 335, 486, 334, 247, 68, 956, 196, 665, 720, 474, 739, 251, 645, 723, 190, 236, 260, 542, 629, 792, 56, 971, 997, 46, 462, 899, 249, 706, 764, 636, 321, 366, 546, 52, 905, 574, 111, 339, 838, 573, 229, 610, 954, 497, 966, 63, 97, 967, 673, 104, 241, 406, 690, 184, 112, 39, 72, 441, 165, 627, 444, 748, 315, 92, 410, 526, 259, 14, 461, 186, 298, 869, 789, 41, 824, 141, 238, 533, 218, 489, 969, 510, 181, 316, 509, 491, 383, 644, 516, 311, 15, 398, 436, 872, 504, 602, 795, 376, 703, 404, 537, 235, 758, 59, 710, 82, 946, 408, 521, 863, 671, 280, 837, 369, 692, 907, 67, 420, 299, 170, 150, 691, 932, 149, 378, 947, 146, 933, 283, 551, 49, 914, 651, 351, 848, 85, 697, 312, 45, 130, 123, 754, 439, 230, 188, 763, 94, 487, 453, 832, 442, 961, 919, 423, 603, 276, 416, 58, 25, 428, 624, 481, 291, 140, 583, 963, 582, 810, 42, 719, 702, 826, 317, 813, 182, 411, 768, 421, 913, 962, 395, 901, 189, 223, 830, 757, 931, 128, 51, 556, 380, 391, 161, 484, 996, 780, 822, 234, 860, 19, 594, 200, 646, 616, 766, 17, 215, 332, 940, 771, 250, 265, 819, 987, 547, 519, 921, 167, 375, 840, 121, 409, 823, 930, 535, 858, 389, 675, 936, 630, 177, 220, 5, 775, 55, 424, 233, 809, 922, 802, 171, 656, 324, 676, 943, 655, 709, 865, 126, 618, 304, 278, 232, 214, 844, 343, 957, 790, 472, 179, 902, 242, 77, 90, 617, 553, 765, 784, 50, 224, 641, 248, 740, 400, 502, 356, 151, 882, 473, 286, 531, 333, 978, 338, 724, 929, 608, 652, 437, 393, 746, 79, 873, 139, 354, 287, 728, 856, 648, 122, 647, 738, 834, 430, 152, 520, 210, 623, 204, 681, 925, 399, 349, 352, 69, 541, 47, 477, 34, 480, 650, 23, 78, 945, 337, 562, 959, 384, 326, 27, 329, 684, 529, 99, 759, 226, 438, 175, 827, 347, 127, 527, 726, 120, 387, 344, 448, 851, 65, 499, 191, 493, 654, 944, 816, 192, 698, 258, 136, 916, 115, 951, 549, 44, 318, 503, 353, 620, 753, 405, 221, 431, 803, 695, 435, 990, 350, 482, 532, 613, 711, 555, 289, 28, 303, 62, 450, 736, 518, 21, 517, 407, 904, 580, 412, 310, 977, 679, 897, 942, 490, 545, 639, 273, 560, 213, 296, 712, 993, 145, 633, 440, 974, 642, 101, 568, 357, 806, 843, 811, 797, 2, 217, 718, 413, 847, 219, 8, 756, 779, 427, 912, 3, 173, 548, 750, 110, 716, 889, 854, 704, 394, 761, 160, 185, 585, 998, 159, 965, 202, 588, 38, 81, 292, 587, 60, 372, 422, 721, 805, 988, 778, 821, 465, 373, 828, 117, 992, 254, 606, 575, 572, 722, 243, 898, 133, 788, 183, 814, 425, 33, 323, 737, 138, 227, 64, 4, 609, 162, 861, 796, 281, 749, 164, 888, 314, 464, 744, 73, 93, 12, 506, 327, 682, 662, 664, 973, 271, 890, 742, 187, 564, 880, 752, 584, 895, 426, 923, 452, 386, 892, 787, 770, 463, 877, 212, 979, 678, 538, 687, 522, 131, 169, 910, 554, 849, 91, 501, 567, 137, 153, 105, 818, 207, 18, 469, 635, 107, 264, 980, 61, 755, 135, 559, 225, 319, 928, 939, 203, 216, 983, 284, 305, 370, 328, 359, 694, 700, 434, 331, 596, 661, 999, 40, 388, 31, 683, 751, 853, 415, 595, 807, 57, 306, 322, 267, 900, 53, 667, 874, 543, 855, 881, 124, 451, 432, 468, 729, 632, 478, 475, 397, 402, 340, 471, 917, 392, 70, 911, 176, 708, 294, 43, 625, 879, 686, 597, 290, 454, 87, 285, 982, 601, 1000, 106, 981, 634, 831, 530, 638, 377, 255, 488, 777, 279, 109, 659, 781, 950, 891, 266, 116, 206, 552, 237, 479, 525, 643, 381, 798, 836, 669, 842, 791, 725, 277, 972, 685, 269, 908, 445, 125, 689, 674, 707, 839, 144, 663, 688, 800, 812, 626, 1, 54, 358, 118, 348, 363, 653, 460, 270, 793, 733, 263, 786, 989, 581, 346, 272, 540, 446, 614, 658, 536, 108, 148, 256, 22 diff --git a/challenge_7/testfiles/t5 b/challenge_7/testfiles/t5 new file mode 100644 index 000000000..19a1b0468 --- /dev/null +++ b/challenge_7/testfiles/t5 @@ -0,0 +1 @@ +151, 243, 695, 806, 327, 974, 353, 996, 294, 749, 387, 104, 247, 807, 462, 103, 447, 286, 718, 754, 681, 141, 486, 813, 879, 824, 200, 405, 705, 121, 39, 499, 202, 712, 921, 893, 96, 665, 430, 176, 358, 186, 892, 840, 791, 277, 916, 66, 145, 809, 229, 146, 966, 206, 896, 851, 983, 253, 293, 346, 740, 171, 870, 679, 767, 564, 596, 256, 692, 932, 237, 756, 199, 172, 377, 738, 645, 710, 766, 102, 414, 431, 660, 470, 440, 819, 642, 944, 706, 402, 44, 529, 364, 972, 192, 631, 683, 480, 528, 128, 696, 933, 501, 598, 383, 793, 682, 477, 357, 571, 10, 25, 533, 57, 593, 815, 567, 498, 26, 366, 321, 56, 140, 491, 669, 550, 542, 219, 850, 620, 844, 971, 578, 545, 511, 33, 829, 585, 580, 568, 371, 241, 211, 788, 177, 742, 674, 265, 673, 152, 980, 711, 812, 628, 530, 312, 203, 63, 65, 181, 17, 951, 164, 935, 468, 131, 623, 59, 307, 671, 93, 880, 318, 639, 993, 295, 569, 549, 408, 79, 607, 858, 539, 75, 138, 90, 45, 845, 618, 557, 886, 356, 888, 394, 505, 672, 289, 116, 60, 328, 532, 597, 848, 778, 546, 920, 797, 426, 261, 608, 196, 911, 52, 600, 997, 551, 614, 34, 949, 210, 137, 108, 707, 461, 984, 956, 463, 270, 337, 640, 8, 41, 942, 554, 412, 169, 527, 478, 743, 174, 406, 832, 601, 266, 113, 348, 889, 745, 117, 15, 37, 49, 453, 163, 937, 188, 9, 838, 144, 547, 411, 523, 735, 304, 479, 320, 182, 744, 299, 784, 989, 941, 668, 448, 661, 159, 508, 801, 946, 700, 274, 502, 856, 101, 464, 198, 143, 81, 374, 846, 915, 541, 105, 195, 436, 78, 610, 653, 525, 729, 861, 385, 12, 217, 91, 675, 509, 632, 543, 234, 42, 290, 301, 129, 876, 647, 646, 611, 179, 779, 421, 422, 214, 92, 313, 73, 149, 795, 606, 654, 787, 883, 378, 599, 555, 869, 977, 484, 990, 830, 362, 544, 907, 561, 676, 363, 388, 887, 940, 134, 130, 333, 626, 615, 88, 416, 583, 811, 928, 864, 150, 899, 855, 215, 519, 457, 227, 124, 763, 703, 194, 804, 396, 267, 438, 959, 31, 170, 842, 389, 250, 493, 538, 373, 147, 602, 471, 913, 395, 258, 562, 967, 998, 168, 531, 559, 450, 379, 753, 701, 516, 709, 774, 155, 558, 713, 927, 429, 460, 4, 458, 757, 173, 276, 746, 342, 428, 725, 973, 857, 863, 338, 822, 799, 878, 417, 834, 891, 576, 678, 929, 643, 156, 769, 398, 637, 349, 577, 968, 865, 693, 380, 994, 677, 764, 27, 433, 617, 708, 157, 325, 603, 760, 594, 13, 114, 240, 605, 344, 451, 187, 496, 473, 53, 604, 183, 789, 400, 489, 97, 446, 663, 384, 894, 688, 553, 467, 975, 782, 271, 82, 135, 345, 407, 814, 919, 322, 717, 74, 521, 736, 303, 794, 964, 148, 847, 825, 945, 884, 339, 239, 609, 697, 221, 279, 960, 213, 722, 21, 591, 111, 419, 987, 310, 329, 714, 343, 306, 474, 909, 522, 835, 106, 917, 792, 651, 305, 67, 197, 820, 630, 465, 882, 410, 319, 1, 254, 931, 986, 875, 770, 456, 524, 860, 208, 415, 723, 495, 3, 658, 443, 19, 657, 280, 393, 995, 284, 283, 852, 992, 263, 251, 635, 699, 690, 48, 910, 747, 868, 347, 165, 184, 816, 119, 512, 257, 666, 23, 730, 399, 28, 55, 761, 392, 831, 418, 826, 224, 86, 733, 391, 575, 427, 773, 737, 837, 6, 513, 287, 20, 755, 629, 308, 914, 649, 466, 685, 316, 582, 765, 359, 207, 58, 731, 963, 40, 622, 38, 71, 315, 167, 83, 401, 332, 361, 424, 225, 324, 514, 397, 947, 47, 719, 334, 459, 120, 341, 24, 535, 275, 30, 988, 872, 300, 958, 100, 638, 107, 29, 867, 123, 836, 587, 950, 912, 581, 827, 762, 235, 490, 953, 664, 802, 805, 375, 54, 260, 627, 785, 370, 536, 572, 367, 520, 297, 783, 534, 839, 734, 595, 255, 775, 249, 231, 728, 590, 386, 125, 439, 552, 644, 35, 633, 158, 574, 897, 954, 991, 800, 72, 435, 434, 472, 962, 69, 455, 768, 849, 943, 885, 641, 786, 922, 924, 492, 979, 482, 715, 758, 727, 126, 985, 64, 112, 272, 475, 311, 686, 22, 246, 592, 823, 803, 680, 751, 901, 61, 750, 808, 372, 506, 874, 494, 724, 667, 780, 238, 452, 616, 244, 469, 938, 323, 142, 613, 881, 759, 62, 11, 981, 281, 110, 978, 908, 704, 877, 153, 684, 68, 918, 230, 796, 563, 579, 955, 368, 193, 841, 721, 526, 454, 698, 98, 162, 423, 204, 957, 828, 588, 507, 220, 1000, 7, 936, 437, 584, 369, 777, 355, 624, 109, 862, 390, 612, 292, 245, 866, 77, 656, 497, 296, 14, 854, 961, 900, 209, 732, 314, 741, 273, 589, 95, 232, 662, 687, 926, 32, 625, 76, 621, 335, 517, 432, 175, 115, 976, 269, 190, 818, 634, 510, 336, 655, 233, 425, 821, 365, 483, 500, 216, 99, 36, 481, 351, 810, 548, 205, 350, 84, 352, 259, 161, 790, 923, 556, 330, 331, 670, 180, 133, 288, 185, 485, 965, 70, 726, 46, 80, 817, 278, 442, 50, 444, 136, 969, 903, 902, 772, 925, 895, 904, 268, 871, 189, 264, 262, 236, 122, 898, 488, 948, 619, 652, 833, 970, 952, 748, 873, 178, 252, 354, 51, 154, 906, 282, 752, 191, 403, 689, 982, 560, 930, 503, 242, 566, 648, 340, 771, 309, 360, 222, 691, 404, 537, 160, 650, 118, 573, 905, 636, 382, 413, 487, 939, 298, 934, 226, 504, 223, 476, 85, 248, 515, 441, 89, 702, 94, 449, 43, 302, 798, 285, 853, 326, 376, 694, 218, 166, 127, 228, 2, 381, 586, 212, 409, 18, 291, 659, 565, 739, 859, 716, 16, 570, 890, 518, 781, 201, 317, 540, 87, 420, 999, 139, 843, 132, 776, 5, 720 From 95f43f57ab1ea7f57091d5f817b63fc95ece4d87 Mon Sep 17 00:00:00 2001 From: Manuel Meraz Date: Tue, 10 Jan 2017 13:13:12 -0800 Subject: [PATCH 02/10] fixed testfiles and readme --- challenge_7/README.md | 2 +- challenge_7/testfiles/t2 | 2 +- challenge_7/testfiles/t3 | 2 +- challenge_7/testfiles/t4 | 2 +- challenge_7/testfiles/t5 | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/challenge_7/README.md b/challenge_7/README.md index cfb49b0b8..58f675586 100644 --- a/challenge_7/README.md +++ b/challenge_7/README.md @@ -48,7 +48,7 @@ assert findMissing([1,3,4,0]) == 2 Expected input: - 1,3,4,0 + 1, 3, 4, 0 Expected output: diff --git a/challenge_7/testfiles/t2 b/challenge_7/testfiles/t2 index 92464eddf..0f80c59d4 100644 --- a/challenge_7/testfiles/t2 +++ b/challenge_7/testfiles/t2 @@ -1 +1 @@ -93, 98, 202, 561, 591, 311, 428, 180, 590, 62, 265, 333, 310, 439, 519, 438, 924, 610, 866, 774, 173, 167, 667, 910, 460, 555, 245, 586, 278, 28, 963, 61, 87, 719, 94, 38, 503, 454, 163, 250, 638, 57, 412, 865, 274, 334, 433, 353, 825, 342, 858, 909, 320, 650, 2, 13, 761, 221, 53, 117, 662, 664, 126, 414, 154, 388, 322, 768, 851, 801, 264, 799, 656, 181, 213, 887, 641, 59, 272, 970, 538, 104, 998, 445, 800, 347, 355, 540, 115, 783, 302, 52, 822, 570, 103, 512, 96, 660, 578, 694, 400, 49, 842, 81, 772, 972, 266, 870, 670, 340, 34, 932, 135, 189, 592, 339, 306, 501, 708, 706, 798, 294, 537, 371, 647, 935, 246, 418, 36, 933, 116, 652, 270, 654, 581, 348, 481, 547, 867, 463, 328, 786, 676, 495, 881, 497, 364, 675, 817, 721, 155, 247, 174, 758, 299, 698, 612, 498, 516, 15, 44, 313, 917, 429, 205, 475, 381, 8, 752, 111, 579, 615, 288, 241, 550, 120, 724, 106, 218, 239, 905, 19, 70, 72, 839, 711, 261, 368, 515, 773, 746, 645, 981, 369, 780, 393, 636, 539, 626, 405, 282, 877, 992, 424, 290, 691, 980, 898, 457, 567, 284, 613, 737, 960, 145, 571, 595, 743, 782, 683, 331, 559, 836, 747, 813, 372, 358, 343, 712, 755, 450, 947, 403, 197, 587, 901, 374, 603, 988, 816, 994, 473, 855, 192, 415, 291, 897, 370, 600, 598, 502, 750, 51, 982, 190, 222, 857, 582, 32, 201, 494, 165, 409, 681, 105, 771, 666, 427, 508, 214, 672, 640, 455, 633, 802, 658, 936, 568, 604, 619, 643, 766, 533, 307, 805, 344, 700, 54, 631, 788, 251, 373, 759, 41, 945, 779, 741, 480, 301, 389, 26, 830, 477, 276, 35, 469, 689, 292, 39, 684, 378, 490, 589, 491, 680, 382, 985, 703, 639, 993, 273, 224, 208, 206, 807, 916, 921, 85, 71, 349, 781, 242, 716, 432, 524, 286, 228, 257, 55, 362, 713, 943, 95, 989, 23, 554, 33, 535, 880, 514, 83, 608, 113, 891, 853, 513, 207, 565, 692, 990, 622, 448, 47, 532, 179, 101, 968, 440, 618, 161, 304, 655, 526, 268, 722, 682, 556, 704, 262, 325, 864, 551, 285, 808, 762, 12, 25, 748, 390, 196, 289, 931, 534, 678, 869, 255, 75, 89, 562, 946, 78, 661, 420, 29, 226, 911, 965, 256, 147, 860, 740, 882, 701, 258, 697, 437, 956, 594, 673, 449, 30, 176, 930, 847, 955, 21, 316, 444, 337, 164, 119, 584, 657, 110, 714, 838, 92, 219, 346, 776, 191, 296, 472, 778, 447, 530, 922, 546, 777, 125, 585, 844, 529, 361, 4, 283, 410, 18, 775, 849, 545, 861, 795, 27, 785, 971, 812, 528, 767, 269, 233, 426, 605, 295, 160, 327, 878, 280, 856, 476, 229, 170, 431, 360, 277, 809, 305, 791, 3, 687, 178, 150, 97, 536, 558, 124, 967, 86, 129, 379, 671, 892, 793, 465, 720, 984, 123, 635, 646, 297, 872, 383, 679, 332, 699, 577, 729, 723, 871, 308, 464, 811, 88, 958, 7, 544, 950, 142, 215, 375, 484, 962, 896, 336, 182, 394, 607, 232, 376, 398, 952, 978, 552, 765, 574, 330, 323, 756, 728, 243, 184, 583, 317, 249, 17, 940, 938, 329, 259, 404, 885, 356, 127, 823, 717, 223, 168, 56, 446, 212, 319, 760, 899, 82, 422, 833, 187, 248, 458, 118, 40, 350, 293, 841, 275, 900, 509, 888, 944, 523, 244, 754, 351, 941, 198, 903, 149, 996, 499, 908, 60, 417, 384, 510, 466, 942, 134, 744, 14, 65, 386, 5, 203, 68, 576, 43, 399, 146, 726, 253, 335, 505, 456, 806, 79, 209, 10, 541, 991, 874, 240, 271, 824, 326, 770, 792, 875, 553, 718, 789, 852, 629, 837, 137, 790, 254, 133, 939, 359, 563, 621, 46, 826, 11, 185, 443, 377, 130, 732, 121, 763, 954, 138, 298, 757, 893, 441, 828, 483, 749, 548, 879, 731, 923, 937, 975, 934, 883, 735, 152, 64, 751, 959, 148, 797, 300, 435, 707, 210, 406, 468, 84, 846, 67, 521, 614, 983, 564, 140, 835, 850, 416, 122, 99, 171, 733, 425, 895, 995, 764, 488, 593, 688, 413, 520, 525, 63, 693, 471, 107, 500, 829, 974, 913, 216, 794, 442, 231, 542, 474, 572, 162, 109, 685, 279, 742, 868, 862, 357, 80, 459, 90, 569, 979, 156, 74, 820, 354, 487, 235, 452, 787, 48, 177, 710, 715, 341, 665, 486, 734, 617, 834, 588, 391, 204, 42, 784, 796, 769, 419, 252, 876, 915, 531, 1000, 193, 637, 345, 653, 462, 482, 100, 669, 467, 58, 620, 493, 397, 738, 227, 573, 580, 436, 843, 624, 131, 642, 918, 725, 606, 37, 527, 45, 999, 511, 599, 132, 902, 73, 200, 453, 24, 611, 854, 627, 695, 925, 169, 220, 949, 211, 560, 492, 804, 401, 690, 144, 926, 961, 904, 434, 648, 281, 470, 158, 727, 367, 172, 395, 803, 927, 819, 630, 884, 69, 966, 912, 363, 314, 402, 387, 845, 575, 230, 318, 396, 315, 22, 948, 886, 407, 506, 977, 953, 906, 479, 815, 651, 894, 920, 814, 217, 183, 507, 518, 951, 686, 139, 928, 461, 128, 411, 237, 151, 702, 267, 238, 848, 321, 108, 709, 504, 236, 649, 889, 859, 696, 597, 91, 736, 234, 112, 907, 831, 496, 623, 114, 312, 914, 136, 517, 602, 986, 632, 596, 663, 186, 392, 287, 745, 522, 6, 303, 76, 969, 478, 77, 225, 260, 188, 601, 634, 668, 175, 143, 677, 157, 352, 141, 365, 543, 263, 199, 609, 16, 628, 753, 957, 9, 338, 66, 31, 557, 873, 616, 987, 489, 50, 821, 625, 810, 366, 309, 194, 674, 919, 964, 890, 153, 159, 929, 1, 705, 827, 566, 324, 451, 973, 380, 997, 644, 485, 20, 430, 659, 739, 421, 549, 408, 730, 166, 818, 195, 840, 385, 863, 832, 976, 423 +0,93, 98, 202, 561, 591, 311, 428, 180, 590, 62, 265, 333, 310, 439, 519, 438, 924, 610, 866, 774, 173, 167, 667, 910, 460, 555, 245, 586, 278, 28, 963, 61, 87, 719, 94, 38, 503, 454, 163, 250, 638, 57, 412, 865, 274, 334, 433, 353, 825, 342, 858, 909, 320, 650, 2, 13, 761, 221, 53, 117, 662, 664, 126, 414, 154, 388, 322, 768, 851, 801, 264, 799, 656, 181, 213, 887, 641, 59, 272, 970, 538, 104, 998, 445, 800, 347, 355, 540, 115, 783, 302, 52, 822, 570, 103, 512, 96, 660, 578, 694, 400, 49, 842, 81, 772, 972, 266, 870, 670, 340, 34, 932, 135, 189, 592, 339, 306, 501, 708, 706, 798, 294, 537, 371, 647, 935, 246, 418, 36, 933, 116, 652, 270, 654, 581, 348, 481, 547, 867, 463, 328, 786, 676, 495, 881, 497, 364, 675, 817, 721, 155, 247, 174, 758, 299, 698, 612, 498, 516, 15, 44, 313, 917, 429, 205, 475, 381, 8, 752, 111, 579, 615, 288, 241, 550, 120, 724, 106, 218, 239, 905, 19, 70, 72, 839, 711, 261, 368, 515, 773, 746, 645, 981, 369, 780, 393, 636, 539, 626, 405, 282, 877, 992, 424, 290, 691, 980, 898, 457, 567, 284, 613, 737, 960, 145, 571, 595, 743, 782, 683, 331, 559, 836, 747, 813, 372, 358, 343, 712, 755, 450, 947, 403, 197, 587, 901, 374, 603, 988, 816, 994, 473, 855, 192, 415, 291, 897, 370, 600, 598, 502, 750, 51, 982, 190, 222, 857, 582, 32, 201, 494, 165, 409, 681, 105, 771, 666, 427, 508, 214, 672, 640, 455, 633, 802, 658, 936, 568, 604, 619, 643, 766, 533, 307, 805, 344, 700, 54, 631, 788, 251, 373, 759, 41, 945, 779, 741, 480, 301, 389, 26, 830, 477, 276, 35, 469, 689, 292, 39, 684, 378, 490, 589, 491, 680, 382, 985, 703, 639, 993, 273, 224, 208, 206, 807, 916, 921, 85, 71, 349, 781, 242, 716, 432, 524, 286, 228, 257, 55, 362, 713, 943, 95, 989, 23, 554, 33, 535, 880, 514, 83, 608, 113, 891, 853, 513, 207, 565, 692, 990, 622, 448, 47, 532, 179, 101, 968, 440, 618, 161, 304, 655, 526, 268, 722, 682, 556, 704, 262, 325, 864, 551, 285, 808, 762, 12, 25, 748, 390, 196, 289, 931, 534, 678, 869, 255, 75, 89, 562, 946, 78, 661, 420, 29, 226, 911, 965, 256, 147, 860, 740, 882, 701, 258, 697, 437, 956, 594, 673, 449, 30, 176, 930, 847, 955, 21, 316, 444, 337, 164, 119, 584, 657, 110, 714, 838, 92, 219, 346, 776, 191, 296, 472, 778, 447, 530, 922, 546, 777, 125, 585, 844, 529, 361, 4, 283, 410, 18, 775, 849, 545, 861, 795, 27, 785, 971, 812, 528, 767, 269, 233, 426, 605, 295, 160, 327, 878, 280, 856, 476, 229, 170, 431, 360, 277, 809, 305, 791, 3, 687, 178, 150, 97, 536, 558, 124, 967, 86, 129, 379, 671, 892, 793, 465, 720, 984, 123, 635, 646, 297, 872, 383, 679, 332, 699, 577, 729, 723, 871, 308, 464, 811, 88, 958, 7, 544, 950, 142, 215, 375, 484, 962, 896, 336, 182, 394, 607, 232, 376, 398, 952, 978, 552, 765, 574, 330, 323, 756, 728, 243, 184, 583, 317, 249, 17, 940, 938, 329, 259, 404, 885, 356, 127, 823, 717, 223, 168, 56, 446, 212, 319, 760, 899, 82, 422, 833, 187, 248, 458, 118, 40, 350, 293, 841, 275, 900, 509, 888, 944, 523, 244, 754, 351, 941, 198, 903, 149, 996, 499, 908, 60, 417, 384, 510, 466, 942, 134, 744, 14, 65, 386, 5, 203, 68, 576, 43, 399, 146, 726, 253, 335, 505, 456, 806, 79, 209, 10, 541, 991, 874, 240, 271, 824, 326, 770, 792, 875, 553, 718, 789, 852, 629, 837, 137, 790, 254, 133, 939, 359, 563, 621, 46, 826, 11, 185, 443, 377, 130, 732, 121, 763, 954, 138, 298, 757, 893, 441, 828, 483, 749, 548, 879, 731, 923, 937, 975, 934, 883, 735, 152, 64, 751, 959, 148, 797, 300, 435, 707, 210, 406, 468, 84, 846, 67, 521, 614, 983, 564, 140, 835, 850, 416, 122, 99, 171, 733, 425, 895, 995, 764, 488, 593, 688, 413, 520, 525, 63, 693, 471, 107, 500, 829, 974, 913, 216, 794, 442, 231, 542, 474, 572, 162, 109, 685, 279, 742, 868, 862, 357, 80, 459, 90, 569, 979, 156, 74, 820, 354, 487, 235, 452, 787, 48, 177, 710, 715, 341, 665, 486, 734, 617, 834, 588, 391, 204, 42, 784, 796, 769, 419, 252, 876, 915, 531, 1000, 193, 637, 345, 653, 462, 482, 100, 669, 467, 58, 620, 493, 397, 738, 227, 573, 580, 436, 843, 624, 131, 642, 918, 725, 606, 37, 527, 45, 999, 511, 599, 132, 902, 73, 200, 453, 24, 611, 854, 627, 695, 925, 169, 220, 949, 211, 560, 492, 804, 401, 690, 144, 926, 961, 904, 434, 648, 281, 470, 158, 727, 367, 172, 395, 803, 927, 819, 630, 884, 69, 966, 912, 363, 314, 402, 387, 845, 575, 230, 318, 396, 315, 22, 948, 886, 407, 506, 977, 953, 906, 479, 815, 651, 894, 920, 814, 217, 183, 507, 518, 951, 686, 139, 928, 461, 128, 411, 237, 151, 702, 267, 238, 848, 321, 108, 709, 504, 236, 649, 889, 859, 696, 597, 91, 736, 234, 112, 907, 831, 496, 623, 114, 312, 914, 136, 517, 602, 986, 632, 596, 663, 186, 392, 287, 745, 522, 6, 303, 76, 969, 478, 77, 225, 260, 188, 601, 634, 668, 175, 143, 677, 157, 352, 141, 365, 543, 263, 199, 609, 16, 628, 753, 957, 9, 338, 66, 31, 557, 873, 616, 987, 489, 50, 821, 625, 810, 366, 309, 194, 674, 919, 964, 890, 153, 159, 929, 1, 705, 827, 566, 324, 451, 973, 380, 997, 644, 485, 20, 430, 659, 739, 421, 549, 408, 730, 166, 818, 195, 840, 385, 863, 832, 976, 423 diff --git a/challenge_7/testfiles/t3 b/challenge_7/testfiles/t3 index 9621e426b..43a659bf2 100644 --- a/challenge_7/testfiles/t3 +++ b/challenge_7/testfiles/t3 @@ -1 +1 @@ -128, 636, 454, 771, 163, 638, 574, 41, 300, 708, 589, 373, 868, 803, 973, 745, 393, 876, 651, 328, 596, 137, 31, 383, 892, 812, 415, 332, 577, 681, 767, 225, 566, 546, 289, 981, 627, 178, 675, 672, 724, 558, 858, 690, 968, 663, 310, 855, 621, 614, 831, 236, 235, 944, 880, 673, 354, 319, 69, 715, 962, 298, 657, 778, 660, 212, 333, 709, 254, 223, 241, 43, 817, 814, 619, 674, 78, 325, 119, 507, 753, 604, 75, 579, 793, 61, 755, 397, 312, 315, 859, 176, 353, 595, 438, 251, 923, 887, 960, 85, 712, 30, 798, 39, 97, 863, 451, 555, 346, 44, 113, 280, 551, 389, 843, 957, 480, 554, 469, 426, 591, 411, 228, 511, 629, 66, 827, 628, 106, 644, 693, 758, 637, 52, 937, 518, 922, 665, 677, 526, 562, 785, 214, 471, 249, 157, 1000, 27, 578, 701, 666, 795, 654, 476, 35, 943, 664, 599, 655, 281, 749, 292, 138, 754, 267, 575, 610, 630, 122, 694, 49, 941, 77, 857, 17, 387, 392, 533, 420, 700, 195, 179, 352, 433, 40, 794, 760, 80, 103, 622, 409, 87, 207, 81, 132, 743, 162, 215, 721, 473, 68, 115, 348, 563, 74, 641, 580, 155, 951, 220, 989, 418, 748, 394, 293, 779, 598, 187, 764, 136, 544, 199, 603, 966, 906, 360, 374, 719, 459, 510, 975, 252, 494, 632, 193, 553, 18, 219, 175, 456, 929, 84, 691, 302, 314, 741, 584, 615, 444, 601, 323, 282, 64, 877, 11, 255, 144, 890, 763, 921, 506, 832, 911, 623, 978, 76, 792, 999, 307, 662, 838, 372, 271, 477, 739, 404, 26, 525, 110, 296, 909, 826, 602, 873, 613, 475, 974, 704, 361, 573, 539, 295, 208, 326, 509, 206, 501, 59, 987, 811, 442, 127, 340, 105, 770, 649, 993, 390, 86, 183, 731, 446, 585, 907, 692, 309, 205, 261, 95, 898, 686, 894, 22, 658, 266, 992, 872, 129, 925, 98, 294, 23, 864, 90, 453, 576, 83, 490, 919, 783, 643, 34, 498, 117, 131, 829, 88, 461, 905, 607, 231, 188, 285, 194, 21, 445, 108, 375, 308, 685, 441, 337, 107, 148, 492, 822, 805, 884, 211, 722, 738, 797, 653, 417, 316, 210, 62, 816, 671, 836, 774, 980, 227, 984, 434, 543, 239, 904, 150, 684, 134, 168, 504, 568, 413, 972, 427, 422, 587, 156, 790, 479, 248, 264, 450, 728, 901, 697, 844, 696, 718, 698, 924, 365, 238, 167, 821, 590, 582, 170, 787, 412, 464, 465, 608, 516, 931, 329, 950, 762, 734, 184, 356, 257, 870, 435, 141, 47, 25, 474, 634, 368, 234, 9, 954, 705, 756, 571, 191, 725, 508, 343, 38, 159, 10, 699, 878, 313, 349, 395, 320, 13, 706, 810, 273, 381, 463, 788, 593, 670, 58, 889, 363, 448, 355, 958, 224, 428, 4, 639, 94, 528, 135, 416, 8, 977, 860, 283, 174, 825, 278, 488, 237, 79, 900, 703, 946, 382, 458, 959, 99, 586, 486, 502, 600, 819, 247, 802, 799, 57, 401, 996, 757, 126, 815, 882, 899, 818, 56, 854, 452, 716, 963, 529, 242, 274, 229, 940, 540, 520, 515, 114, 626, 895, 569, 16, 303, 971, 327, 625, 192, 478, 841, 519, 481, 334, 581, 250, 423, 118, 856, 765, 559, 530, 786, 552, 288, 145, 970, 204, 936, 466, 514, 914, 885, 503, 640, 405, 344, 824, 149, 152, 109, 233, 983, 116, 111, 161, 364, 260, 594, 740, 549, 867, 151, 945, 532, 744, 166, 447, 29, 269, 661, 350, 597, 198, 875, 656, 200, 617, 385, 809, 359, 321, 245, 723, 956, 534, 648, 28, 402, 935, 324, 142, 967, 730, 12, 733, 32, 272, 357, 244, 499, 268, 301, 695, 263, 378, 100, 489, 897, 933, 707, 548, 522, 891, 14, 560, 646, 336, 583, 362, 297, 776, 611, 759, 487, 338, 545, 952, 177, 605, 995, 305, 379, 91, 982, 386, 275, 547, 286, 830, 871, 342, 462, 642, 976, 717, 979, 834, 942, 101, 513, 197, 847, 866, 376, 620, 969, 366, 377, 318, 961, 679, 848, 688, 736, 449, 726, 82, 380, 561, 635, 683, 702, 190, 495, 2, 927, 71, 550, 51, 631, 496, 121, 276, 588, 455, 33, 947, 505, 217, 398, 773, 606, 182, 67, 955, 143, 185, 918, 124, 133, 287, 850, 851, 938, 652, 139, 424, 367, 54, 60, 347, 840, 839, 714, 371, 800, 737, 258, 203, 645, 915, 73, 994, 246, 370, 399, 965, 265, 436, 104, 226, 852, 153, 304, 732, 256, 470, 557, 853, 403, 216, 813, 678, 485, 669, 172, 990, 484, 408, 102, 556, 406, 93, 483, 230, 421, 680, 5, 112, 835, 6, 953, 196, 570, 388, 537, 542, 468, 784, 186, 284, 916, 384, 808, 879, 221, 330, 780, 567, 926, 667, 751, 912, 158, 432, 48, 414, 536, 430, 865, 72, 747, 893, 351, 849, 727, 908, 775, 592, 729, 20, 997, 202, 345, 777, 531, 120, 512, 437, 837, 55, 902, 659, 523, 934, 949, 439, 171, 222, 140, 948, 711, 218, 154, 517, 419, 920, 19, 240, 279, 45, 874, 564, 491, 331, 846, 572, 917, 1, 37, 761, 633, 50, 881, 457, 232, 123, 467, 181, 24, 789, 130, 928, 443, 259, 986, 146, 535, 369, 322, 913, 612, 189, 782, 42, 173, 689, 425, 710, 998, 930, 650, 429, 820, 616, 7, 713, 270, 903, 735, 440, 687, 791, 769, 472, 527, 3, 618, 96, 500, 410, 766, 886, 796, 910, 15, 89, 720, 524, 565, 932, 290, 768, 299, 742, 823, 253, 53, 46, 306, 482, 676, 647, 396, 209, 213, 801, 317, 493, 781, 888, 521, 125, 964, 842, 341, 70, 277, 807, 861, 311, 772, 160, 682, 985, 335, 869, 201, 262, 862, 896, 624, 243, 668, 169, 541, 828, 431, 609, 752, 804, 806, 991, 65, 746, 833, 883, 164, 750, 460, 538, 291, 358, 180, 497, 400, 36, 147, 391, 165, 407, 92, 939, 63, 988, 845 +0, 128, 636, 454, 771, 163, 638, 574, 41, 300, 708, 589, 373, 868, 803, 973, 745, 393, 876, 651, 328, 596, 137, 31, 383, 892, 812, 415, 332, 577, 681, 767, 225, 566, 546, 289, 981, 627, 178, 675, 672, 724, 558, 858, 690, 968, 663, 310, 855, 621, 614, 831, 236, 235, 944, 880, 673, 354, 319, 69, 715, 962, 298, 657, 778, 660, 212, 333, 709, 254, 223, 241, 43, 817, 814, 619, 674, 78, 325, 119, 507, 753, 604, 75, 579, 793, 61, 755, 397, 312, 315, 859, 176, 353, 595, 438, 251, 923, 887, 960, 85, 712, 30, 798, 39, 97, 863, 451, 555, 346, 44, 113, 280, 551, 389, 843, 957, 480, 554, 469, 426, 591, 411, 228, 511, 629, 66, 827, 628, 106, 644, 693, 758, 637, 52, 937, 518, 922, 665, 677, 526, 562, 785, 214, 471, 249, 157, 1000, 27, 578, 701, 666, 795, 654, 476, 35, 943, 664, 599, 655, 281, 749, 292, 138, 754, 267, 575, 610, 630, 122, 694, 49, 941, 77, 857, 17, 387, 392, 533, 420, 700, 195, 179, 352, 433, 40, 794, 760, 80, 103, 622, 409, 87, 207, 81, 132, 743, 162, 215, 721, 473, 68, 115, 348, 563, 74, 641, 580, 155, 951, 220, 989, 418, 748, 394, 293, 779, 598, 187, 764, 136, 544, 199, 603, 966, 906, 360, 374, 719, 459, 510, 975, 252, 494, 632, 193, 553, 18, 219, 175, 456, 929, 84, 691, 302, 314, 741, 584, 615, 444, 601, 323, 282, 64, 877, 11, 255, 144, 890, 763, 921, 506, 832, 911, 623, 978, 76, 792, 999, 307, 662, 838, 372, 271, 477, 739, 404, 26, 525, 110, 296, 909, 826, 602, 873, 613, 475, 974, 704, 361, 573, 539, 295, 208, 326, 509, 206, 501, 59, 987, 811, 442, 127, 340, 105, 770, 649, 993, 390, 86, 183, 731, 446, 585, 907, 692, 309, 205, 261, 95, 898, 686, 894, 22, 658, 266, 992, 872, 129, 925, 98, 294, 23, 864, 90, 453, 576, 83, 490, 919, 783, 643, 34, 498, 117, 131, 829, 88, 461, 905, 607, 231, 188, 285, 194, 21, 445, 108, 375, 308, 685, 441, 337, 107, 148, 492, 822, 805, 884, 211, 722, 738, 797, 653, 417, 316, 210, 62, 816, 671, 836, 774, 980, 227, 984, 434, 543, 239, 904, 150, 684, 134, 168, 504, 568, 413, 972, 427, 422, 587, 156, 790, 479, 248, 264, 450, 728, 901, 697, 844, 696, 718, 698, 924, 365, 238, 167, 821, 590, 582, 170, 787, 412, 464, 465, 608, 516, 931, 329, 950, 762, 734, 184, 356, 257, 870, 435, 141, 47, 25, 474, 634, 368, 234, 9, 954, 705, 756, 571, 191, 725, 508, 343, 38, 159, 10, 699, 878, 313, 349, 395, 320, 13, 706, 810, 273, 381, 463, 788, 593, 670, 58, 889, 363, 448, 355, 958, 224, 428, 4, 639, 94, 528, 135, 416, 8, 977, 860, 283, 174, 825, 278, 488, 237, 79, 900, 703, 946, 382, 458, 959, 99, 586, 486, 502, 600, 819, 247, 802, 799, 57, 401, 996, 757, 126, 815, 882, 899, 818, 56, 854, 452, 716, 963, 529, 242, 274, 229, 940, 540, 520, 515, 114, 626, 895, 569, 16, 303, 971, 327, 625, 192, 478, 841, 519, 481, 334, 581, 250, 423, 118, 856, 765, 559, 530, 786, 552, 288, 145, 970, 204, 936, 466, 514, 914, 885, 503, 640, 405, 344, 824, 149, 152, 109, 233, 983, 116, 111, 161, 364, 260, 594, 740, 549, 867, 151, 945, 532, 744, 166, 447, 29, 269, 661, 350, 597, 198, 875, 656, 200, 617, 385, 809, 359, 321, 245, 723, 956, 534, 648, 28, 402, 935, 324, 142, 967, 730, 12, 733, 32, 272, 357, 244, 499, 268, 301, 695, 263, 378, 100, 489, 897, 933, 707, 548, 522, 891, 14, 560, 646, 336, 583, 362, 297, 776, 611, 759, 487, 338, 545, 952, 177, 605, 995, 305, 379, 91, 982, 386, 275, 547, 286, 830, 871, 342, 462, 642, 976, 717, 979, 834, 942, 101, 513, 197, 847, 866, 376, 620, 969, 366, 377, 318, 961, 679, 848, 688, 736, 449, 726, 82, 380, 561, 635, 683, 702, 190, 495, 2, 927, 71, 550, 51, 631, 496, 121, 276, 588, 455, 33, 947, 505, 217, 398, 773, 606, 182, 67, 955, 143, 185, 918, 124, 133, 287, 850, 851, 938, 652, 139, 424, 367, 54, 60, 347, 840, 839, 714, 371, 800, 737, 258, 203, 645, 915, 73, 994, 246, 370, 399, 965, 265, 436, 104, 226, 852, 153, 304, 732, 256, 470, 557, 853, 403, 216, 813, 678, 485, 669, 172, 990, 484, 408, 102, 556, 406, 93, 483, 230, 421, 680, 5, 112, 835, 6, 953, 196, 570, 388, 537, 542, 468, 784, 186, 284, 916, 384, 808, 879, 221, 330, 780, 567, 926, 667, 751, 912, 158, 432, 48, 414, 536, 430, 865, 72, 747, 893, 351, 849, 727, 908, 775, 592, 729, 20, 997, 202, 345, 777, 531, 120, 512, 437, 837, 55, 902, 659, 523, 934, 949, 439, 171, 222, 140, 948, 711, 218, 154, 517, 419, 920, 19, 240, 279, 45, 874, 564, 491, 331, 846, 572, 917, 1, 37, 761, 633, 50, 881, 457, 232, 123, 467, 181, 24, 789, 130, 928, 443, 259, 986, 146, 535, 369, 322, 913, 612, 189, 782, 42, 173, 689, 425, 710, 998, 930, 650, 429, 820, 616, 7, 713, 270, 903, 735, 440, 687, 791, 769, 472, 527, 3, 618, 96, 500, 410, 766, 886, 796, 910, 15, 89, 720, 524, 565, 932, 290, 768, 299, 742, 823, 253, 53, 46, 306, 482, 676, 647, 396, 209, 213, 801, 317, 493, 781, 888, 521, 125, 964, 842, 341, 70, 277, 807, 861, 311, 772, 160, 682, 985, 335, 869, 201, 262, 862, 896, 624, 243, 668, 169, 541, 828, 431, 609, 752, 804, 806, 991, 65, 746, 833, 883, 164, 750, 460, 538, 291, 358, 180, 497, 400, 36, 147, 391, 165, 407, 92, 939, 63, 988, 845 diff --git a/challenge_7/testfiles/t4 b/challenge_7/testfiles/t4 index 11f0eb556..c2efb7c16 100644 --- a/challenge_7/testfiles/t4 +++ b/challenge_7/testfiles/t4 @@ -1 +1 @@ -147, 495, 24, 743, 876, 592, 558, 841, 782, 852, 528, 505, 878, 261, 734, 396, 660, 870, 550, 13, 449, 732, 672, 29, 470, 507, 246, 222, 801, 455, 586, 11, 205, 88, 98, 938, 964, 433, 953, 275, 699, 113, 199, 862, 960, 483, 119, 382, 208, 7, 456, 701, 666, 308, 808, 96, 485, 927, 157, 762, 677, 696, 557, 991, 20, 447, 459, 705, 893, 986, 747, 565, 172, 894, 693, 511, 467, 970, 622, 178, 915, 419, 670, 364, 512, 365, 896, 628, 95, 561, 496, 833, 825, 66, 887, 589, 934, 713, 443, 134, 154, 514, 302, 857, 949, 257, 571, 368, 26, 367, 937, 35, 883, 926, 418, 593, 156, 307, 591, 282, 846, 371, 903, 829, 313, 735, 868, 577, 859, 804, 84, 262, 579, 174, 948, 566, 309, 466, 621, 845, 390, 30, 715, 820, 785, 604, 924, 619, 611, 866, 166, 336, 680, 201, 772, 605, 193, 534, 539, 867, 984, 500, 955, 244, 142, 835, 301, 727, 168, 355, 598, 850, 342, 578, 385, 920, 197, 360, 590, 48, 570, 731, 783, 401, 245, 211, 37, 612, 513, 906, 649, 16, 194, 886, 198, 209, 458, 457, 515, 631, 297, 100, 362, 32, 155, 274, 300, 379, 86, 935, 563, 114, 714, 83, 320, 637, 815, 374, 717, 958, 918, 268, 975, 741, 508, 417, 599, 995, 75, 941, 36, 769, 103, 615, 228, 909, 524, 569, 745, 884, 864, 885, 163, 239, 231, 132, 71, 9, 760, 288, 498, 295, 817, 143, 794, 325, 476, 403, 253, 600, 240, 985, 361, 767, 158, 293, 774, 74, 345, 657, 668, 10, 102, 799, 76, 640, 492, 773, 252, 523, 994, 180, 776, 976, 80, 576, 330, 871, 129, 952, 341, 429, 544, 607, 6, 89, 875, 494, 414, 968, 195, 335, 486, 334, 247, 68, 956, 196, 665, 720, 474, 739, 251, 645, 723, 190, 236, 260, 542, 629, 792, 56, 971, 997, 46, 462, 899, 249, 706, 764, 636, 321, 366, 546, 52, 905, 574, 111, 339, 838, 573, 229, 610, 954, 497, 966, 63, 97, 967, 673, 104, 241, 406, 690, 184, 112, 39, 72, 441, 165, 627, 444, 748, 315, 92, 410, 526, 259, 14, 461, 186, 298, 869, 789, 41, 824, 141, 238, 533, 218, 489, 969, 510, 181, 316, 509, 491, 383, 644, 516, 311, 15, 398, 436, 872, 504, 602, 795, 376, 703, 404, 537, 235, 758, 59, 710, 82, 946, 408, 521, 863, 671, 280, 837, 369, 692, 907, 67, 420, 299, 170, 150, 691, 932, 149, 378, 947, 146, 933, 283, 551, 49, 914, 651, 351, 848, 85, 697, 312, 45, 130, 123, 754, 439, 230, 188, 763, 94, 487, 453, 832, 442, 961, 919, 423, 603, 276, 416, 58, 25, 428, 624, 481, 291, 140, 583, 963, 582, 810, 42, 719, 702, 826, 317, 813, 182, 411, 768, 421, 913, 962, 395, 901, 189, 223, 830, 757, 931, 128, 51, 556, 380, 391, 161, 484, 996, 780, 822, 234, 860, 19, 594, 200, 646, 616, 766, 17, 215, 332, 940, 771, 250, 265, 819, 987, 547, 519, 921, 167, 375, 840, 121, 409, 823, 930, 535, 858, 389, 675, 936, 630, 177, 220, 5, 775, 55, 424, 233, 809, 922, 802, 171, 656, 324, 676, 943, 655, 709, 865, 126, 618, 304, 278, 232, 214, 844, 343, 957, 790, 472, 179, 902, 242, 77, 90, 617, 553, 765, 784, 50, 224, 641, 248, 740, 400, 502, 356, 151, 882, 473, 286, 531, 333, 978, 338, 724, 929, 608, 652, 437, 393, 746, 79, 873, 139, 354, 287, 728, 856, 648, 122, 647, 738, 834, 430, 152, 520, 210, 623, 204, 681, 925, 399, 349, 352, 69, 541, 47, 477, 34, 480, 650, 23, 78, 945, 337, 562, 959, 384, 326, 27, 329, 684, 529, 99, 759, 226, 438, 175, 827, 347, 127, 527, 726, 120, 387, 344, 448, 851, 65, 499, 191, 493, 654, 944, 816, 192, 698, 258, 136, 916, 115, 951, 549, 44, 318, 503, 353, 620, 753, 405, 221, 431, 803, 695, 435, 990, 350, 482, 532, 613, 711, 555, 289, 28, 303, 62, 450, 736, 518, 21, 517, 407, 904, 580, 412, 310, 977, 679, 897, 942, 490, 545, 639, 273, 560, 213, 296, 712, 993, 145, 633, 440, 974, 642, 101, 568, 357, 806, 843, 811, 797, 2, 217, 718, 413, 847, 219, 8, 756, 779, 427, 912, 3, 173, 548, 750, 110, 716, 889, 854, 704, 394, 761, 160, 185, 585, 998, 159, 965, 202, 588, 38, 81, 292, 587, 60, 372, 422, 721, 805, 988, 778, 821, 465, 373, 828, 117, 992, 254, 606, 575, 572, 722, 243, 898, 133, 788, 183, 814, 425, 33, 323, 737, 138, 227, 64, 4, 609, 162, 861, 796, 281, 749, 164, 888, 314, 464, 744, 73, 93, 12, 506, 327, 682, 662, 664, 973, 271, 890, 742, 187, 564, 880, 752, 584, 895, 426, 923, 452, 386, 892, 787, 770, 463, 877, 212, 979, 678, 538, 687, 522, 131, 169, 910, 554, 849, 91, 501, 567, 137, 153, 105, 818, 207, 18, 469, 635, 107, 264, 980, 61, 755, 135, 559, 225, 319, 928, 939, 203, 216, 983, 284, 305, 370, 328, 359, 694, 700, 434, 331, 596, 661, 999, 40, 388, 31, 683, 751, 853, 415, 595, 807, 57, 306, 322, 267, 900, 53, 667, 874, 543, 855, 881, 124, 451, 432, 468, 729, 632, 478, 475, 397, 402, 340, 471, 917, 392, 70, 911, 176, 708, 294, 43, 625, 879, 686, 597, 290, 454, 87, 285, 982, 601, 1000, 106, 981, 634, 831, 530, 638, 377, 255, 488, 777, 279, 109, 659, 781, 950, 891, 266, 116, 206, 552, 237, 479, 525, 643, 381, 798, 836, 669, 842, 791, 725, 277, 972, 685, 269, 908, 445, 125, 689, 674, 707, 839, 144, 663, 688, 800, 812, 626, 1, 54, 358, 118, 348, 363, 653, 460, 270, 793, 733, 263, 786, 989, 581, 346, 272, 540, 446, 614, 658, 536, 108, 148, 256, 22 +0, 147, 495, 24, 743, 876, 592, 558, 841, 782, 852, 528, 505, 878, 261, 734, 396, 660, 870, 550, 13, 449, 732, 672, 29, 470, 507, 246, 222, 801, 455, 586, 11, 205, 88, 98, 938, 964, 433, 953, 275, 699, 113, 199, 862, 960, 483, 119, 382, 208, 7, 456, 701, 666, 308, 808, 96, 485, 927, 157, 762, 677, 696, 557, 991, 20, 447, 459, 705, 893, 986, 747, 565, 172, 894, 693, 511, 467, 970, 622, 178, 915, 419, 670, 364, 512, 365, 896, 628, 95, 561, 496, 833, 825, 66, 887, 589, 934, 713, 443, 134, 154, 514, 302, 857, 949, 257, 571, 368, 26, 367, 937, 35, 883, 926, 418, 593, 156, 307, 591, 282, 846, 371, 903, 829, 313, 735, 868, 577, 859, 804, 84, 262, 579, 174, 948, 566, 309, 466, 621, 845, 390, 30, 715, 820, 785, 604, 924, 619, 611, 866, 166, 336, 680, 201, 772, 605, 193, 534, 539, 867, 984, 500, 955, 244, 142, 835, 301, 727, 168, 355, 598, 850, 342, 578, 385, 920, 197, 360, 590, 48, 570, 731, 783, 401, 245, 211, 37, 612, 513, 906, 649, 16, 194, 886, 198, 209, 458, 457, 515, 631, 297, 100, 362, 32, 155, 274, 300, 379, 86, 935, 563, 114, 714, 83, 320, 637, 815, 374, 717, 958, 918, 268, 975, 741, 508, 417, 599, 995, 75, 941, 36, 769, 103, 615, 228, 909, 524, 569, 745, 884, 864, 885, 163, 239, 231, 132, 71, 9, 760, 288, 498, 295, 817, 143, 794, 325, 476, 403, 253, 600, 240, 985, 361, 767, 158, 293, 774, 74, 345, 657, 668, 10, 102, 799, 76, 640, 492, 773, 252, 523, 994, 180, 776, 976, 80, 576, 330, 871, 129, 952, 341, 429, 544, 607, 6, 89, 875, 494, 414, 968, 195, 335, 486, 334, 247, 68, 956, 196, 665, 720, 474, 739, 251, 645, 723, 190, 236, 260, 542, 629, 792, 56, 971, 997, 46, 462, 899, 249, 706, 764, 636, 321, 366, 546, 52, 905, 574, 111, 339, 838, 573, 229, 610, 954, 497, 966, 63, 97, 967, 673, 104, 241, 406, 690, 184, 112, 39, 72, 441, 165, 627, 444, 748, 315, 92, 410, 526, 259, 14, 461, 186, 298, 869, 789, 41, 824, 141, 238, 533, 218, 489, 969, 510, 181, 316, 509, 491, 383, 644, 516, 311, 15, 398, 436, 872, 504, 602, 795, 376, 703, 404, 537, 235, 758, 59, 710, 82, 946, 408, 521, 863, 671, 280, 837, 369, 692, 907, 67, 420, 299, 170, 150, 691, 932, 149, 378, 947, 146, 933, 283, 551, 49, 914, 651, 351, 848, 85, 697, 312, 45, 130, 123, 754, 439, 230, 188, 763, 94, 487, 453, 832, 442, 961, 919, 423, 603, 276, 416, 58, 25, 428, 624, 481, 291, 140, 583, 963, 582, 810, 42, 719, 702, 826, 317, 813, 182, 411, 768, 421, 913, 962, 395, 901, 189, 223, 830, 757, 931, 128, 51, 556, 380, 391, 161, 484, 996, 780, 822, 234, 860, 19, 594, 200, 646, 616, 766, 17, 215, 332, 940, 771, 250, 265, 819, 987, 547, 519, 921, 167, 375, 840, 121, 409, 823, 930, 535, 858, 389, 675, 936, 630, 177, 220, 5, 775, 55, 424, 233, 809, 922, 802, 171, 656, 324, 676, 943, 655, 709, 865, 126, 618, 304, 278, 232, 214, 844, 343, 957, 790, 472, 179, 902, 242, 77, 90, 617, 553, 765, 784, 50, 224, 641, 248, 740, 400, 502, 356, 151, 882, 473, 286, 531, 333, 978, 338, 724, 929, 608, 652, 437, 393, 746, 79, 873, 139, 354, 287, 728, 856, 648, 122, 647, 738, 834, 430, 152, 520, 210, 623, 204, 681, 925, 399, 349, 352, 69, 541, 47, 477, 34, 480, 650, 23, 78, 945, 337, 562, 959, 384, 326, 27, 329, 684, 529, 99, 759, 226, 438, 175, 827, 347, 127, 527, 726, 120, 387, 344, 448, 851, 65, 499, 191, 493, 654, 944, 816, 192, 698, 258, 136, 916, 115, 951, 549, 44, 318, 503, 353, 620, 753, 405, 221, 431, 803, 695, 435, 990, 350, 482, 532, 613, 711, 555, 289, 28, 303, 62, 450, 736, 518, 21, 517, 407, 904, 580, 412, 310, 977, 679, 897, 942, 490, 545, 639, 273, 560, 213, 296, 712, 993, 145, 633, 440, 974, 642, 101, 568, 357, 806, 843, 811, 797, 2, 217, 718, 413, 847, 219, 8, 756, 779, 427, 912, 3, 173, 548, 750, 110, 716, 889, 854, 704, 394, 761, 160, 185, 585, 998, 159, 965, 202, 588, 38, 81, 292, 587, 60, 372, 422, 721, 805, 988, 778, 821, 465, 373, 828, 117, 992, 254, 606, 575, 572, 722, 243, 898, 133, 788, 183, 814, 425, 33, 323, 737, 138, 227, 64, 4, 609, 162, 861, 796, 281, 749, 164, 888, 314, 464, 744, 73, 93, 12, 506, 327, 682, 662, 664, 973, 271, 890, 742, 187, 564, 880, 752, 584, 895, 426, 923, 452, 386, 892, 787, 770, 463, 877, 212, 979, 678, 538, 687, 522, 131, 169, 910, 554, 849, 91, 501, 567, 137, 153, 105, 818, 207, 18, 469, 635, 107, 264, 980, 61, 755, 135, 559, 225, 319, 928, 939, 203, 216, 983, 284, 305, 370, 328, 359, 694, 700, 434, 331, 596, 661, 999, 40, 388, 31, 683, 751, 853, 415, 595, 807, 57, 306, 322, 267, 900, 53, 667, 874, 543, 855, 881, 124, 451, 432, 468, 729, 632, 478, 475, 397, 402, 340, 471, 917, 392, 70, 911, 176, 708, 294, 43, 625, 879, 686, 597, 290, 454, 87, 285, 982, 601, 1000, 106, 981, 634, 831, 530, 638, 377, 255, 488, 777, 279, 109, 659, 781, 950, 891, 266, 116, 206, 552, 237, 479, 525, 643, 381, 798, 836, 669, 842, 791, 725, 277, 972, 685, 269, 908, 445, 125, 689, 674, 707, 839, 144, 663, 688, 800, 812, 626, 1, 54, 358, 118, 348, 363, 653, 460, 270, 793, 733, 263, 786, 989, 581, 346, 272, 540, 446, 614, 658, 536, 108, 148, 256, 22 diff --git a/challenge_7/testfiles/t5 b/challenge_7/testfiles/t5 index 19a1b0468..51c2c9c99 100644 --- a/challenge_7/testfiles/t5 +++ b/challenge_7/testfiles/t5 @@ -1 +1 @@ -151, 243, 695, 806, 327, 974, 353, 996, 294, 749, 387, 104, 247, 807, 462, 103, 447, 286, 718, 754, 681, 141, 486, 813, 879, 824, 200, 405, 705, 121, 39, 499, 202, 712, 921, 893, 96, 665, 430, 176, 358, 186, 892, 840, 791, 277, 916, 66, 145, 809, 229, 146, 966, 206, 896, 851, 983, 253, 293, 346, 740, 171, 870, 679, 767, 564, 596, 256, 692, 932, 237, 756, 199, 172, 377, 738, 645, 710, 766, 102, 414, 431, 660, 470, 440, 819, 642, 944, 706, 402, 44, 529, 364, 972, 192, 631, 683, 480, 528, 128, 696, 933, 501, 598, 383, 793, 682, 477, 357, 571, 10, 25, 533, 57, 593, 815, 567, 498, 26, 366, 321, 56, 140, 491, 669, 550, 542, 219, 850, 620, 844, 971, 578, 545, 511, 33, 829, 585, 580, 568, 371, 241, 211, 788, 177, 742, 674, 265, 673, 152, 980, 711, 812, 628, 530, 312, 203, 63, 65, 181, 17, 951, 164, 935, 468, 131, 623, 59, 307, 671, 93, 880, 318, 639, 993, 295, 569, 549, 408, 79, 607, 858, 539, 75, 138, 90, 45, 845, 618, 557, 886, 356, 888, 394, 505, 672, 289, 116, 60, 328, 532, 597, 848, 778, 546, 920, 797, 426, 261, 608, 196, 911, 52, 600, 997, 551, 614, 34, 949, 210, 137, 108, 707, 461, 984, 956, 463, 270, 337, 640, 8, 41, 942, 554, 412, 169, 527, 478, 743, 174, 406, 832, 601, 266, 113, 348, 889, 745, 117, 15, 37, 49, 453, 163, 937, 188, 9, 838, 144, 547, 411, 523, 735, 304, 479, 320, 182, 744, 299, 784, 989, 941, 668, 448, 661, 159, 508, 801, 946, 700, 274, 502, 856, 101, 464, 198, 143, 81, 374, 846, 915, 541, 105, 195, 436, 78, 610, 653, 525, 729, 861, 385, 12, 217, 91, 675, 509, 632, 543, 234, 42, 290, 301, 129, 876, 647, 646, 611, 179, 779, 421, 422, 214, 92, 313, 73, 149, 795, 606, 654, 787, 883, 378, 599, 555, 869, 977, 484, 990, 830, 362, 544, 907, 561, 676, 363, 388, 887, 940, 134, 130, 333, 626, 615, 88, 416, 583, 811, 928, 864, 150, 899, 855, 215, 519, 457, 227, 124, 763, 703, 194, 804, 396, 267, 438, 959, 31, 170, 842, 389, 250, 493, 538, 373, 147, 602, 471, 913, 395, 258, 562, 967, 998, 168, 531, 559, 450, 379, 753, 701, 516, 709, 774, 155, 558, 713, 927, 429, 460, 4, 458, 757, 173, 276, 746, 342, 428, 725, 973, 857, 863, 338, 822, 799, 878, 417, 834, 891, 576, 678, 929, 643, 156, 769, 398, 637, 349, 577, 968, 865, 693, 380, 994, 677, 764, 27, 433, 617, 708, 157, 325, 603, 760, 594, 13, 114, 240, 605, 344, 451, 187, 496, 473, 53, 604, 183, 789, 400, 489, 97, 446, 663, 384, 894, 688, 553, 467, 975, 782, 271, 82, 135, 345, 407, 814, 919, 322, 717, 74, 521, 736, 303, 794, 964, 148, 847, 825, 945, 884, 339, 239, 609, 697, 221, 279, 960, 213, 722, 21, 591, 111, 419, 987, 310, 329, 714, 343, 306, 474, 909, 522, 835, 106, 917, 792, 651, 305, 67, 197, 820, 630, 465, 882, 410, 319, 1, 254, 931, 986, 875, 770, 456, 524, 860, 208, 415, 723, 495, 3, 658, 443, 19, 657, 280, 393, 995, 284, 283, 852, 992, 263, 251, 635, 699, 690, 48, 910, 747, 868, 347, 165, 184, 816, 119, 512, 257, 666, 23, 730, 399, 28, 55, 761, 392, 831, 418, 826, 224, 86, 733, 391, 575, 427, 773, 737, 837, 6, 513, 287, 20, 755, 629, 308, 914, 649, 466, 685, 316, 582, 765, 359, 207, 58, 731, 963, 40, 622, 38, 71, 315, 167, 83, 401, 332, 361, 424, 225, 324, 514, 397, 947, 47, 719, 334, 459, 120, 341, 24, 535, 275, 30, 988, 872, 300, 958, 100, 638, 107, 29, 867, 123, 836, 587, 950, 912, 581, 827, 762, 235, 490, 953, 664, 802, 805, 375, 54, 260, 627, 785, 370, 536, 572, 367, 520, 297, 783, 534, 839, 734, 595, 255, 775, 249, 231, 728, 590, 386, 125, 439, 552, 644, 35, 633, 158, 574, 897, 954, 991, 800, 72, 435, 434, 472, 962, 69, 455, 768, 849, 943, 885, 641, 786, 922, 924, 492, 979, 482, 715, 758, 727, 126, 985, 64, 112, 272, 475, 311, 686, 22, 246, 592, 823, 803, 680, 751, 901, 61, 750, 808, 372, 506, 874, 494, 724, 667, 780, 238, 452, 616, 244, 469, 938, 323, 142, 613, 881, 759, 62, 11, 981, 281, 110, 978, 908, 704, 877, 153, 684, 68, 918, 230, 796, 563, 579, 955, 368, 193, 841, 721, 526, 454, 698, 98, 162, 423, 204, 957, 828, 588, 507, 220, 1000, 7, 936, 437, 584, 369, 777, 355, 624, 109, 862, 390, 612, 292, 245, 866, 77, 656, 497, 296, 14, 854, 961, 900, 209, 732, 314, 741, 273, 589, 95, 232, 662, 687, 926, 32, 625, 76, 621, 335, 517, 432, 175, 115, 976, 269, 190, 818, 634, 510, 336, 655, 233, 425, 821, 365, 483, 500, 216, 99, 36, 481, 351, 810, 548, 205, 350, 84, 352, 259, 161, 790, 923, 556, 330, 331, 670, 180, 133, 288, 185, 485, 965, 70, 726, 46, 80, 817, 278, 442, 50, 444, 136, 969, 903, 902, 772, 925, 895, 904, 268, 871, 189, 264, 262, 236, 122, 898, 488, 948, 619, 652, 833, 970, 952, 748, 873, 178, 252, 354, 51, 154, 906, 282, 752, 191, 403, 689, 982, 560, 930, 503, 242, 566, 648, 340, 771, 309, 360, 222, 691, 404, 537, 160, 650, 118, 573, 905, 636, 382, 413, 487, 939, 298, 934, 226, 504, 223, 476, 85, 248, 515, 441, 89, 702, 94, 449, 43, 302, 798, 285, 853, 326, 376, 694, 218, 166, 127, 228, 2, 381, 586, 212, 409, 18, 291, 659, 565, 739, 859, 716, 16, 570, 890, 518, 781, 201, 317, 540, 87, 420, 999, 139, 843, 132, 776, 5, 720 +0, 151, 243, 695, 806, 327, 974, 353, 996, 294, 749, 387, 104, 247, 807, 462, 103, 447, 286, 718, 754, 681, 141, 486, 813, 879, 824, 200, 405, 705, 121, 39, 499, 202, 712, 921, 893, 96, 665, 430, 176, 358, 186, 892, 840, 791, 277, 916, 66, 145, 809, 229, 146, 966, 206, 896, 851, 983, 253, 293, 346, 740, 171, 870, 679, 767, 564, 596, 256, 692, 932, 237, 756, 199, 172, 377, 738, 645, 710, 766, 102, 414, 431, 660, 470, 440, 819, 642, 944, 706, 402, 44, 529, 364, 972, 192, 631, 683, 480, 528, 128, 696, 933, 501, 598, 383, 793, 682, 477, 357, 571, 10, 25, 533, 57, 593, 815, 567, 498, 26, 366, 321, 56, 140, 491, 669, 550, 542, 219, 850, 620, 844, 971, 578, 545, 511, 33, 829, 585, 580, 568, 371, 241, 211, 788, 177, 742, 674, 265, 673, 152, 980, 711, 812, 628, 530, 312, 203, 63, 65, 181, 17, 951, 164, 935, 468, 131, 623, 59, 307, 671, 93, 880, 318, 639, 993, 295, 569, 549, 408, 79, 607, 858, 539, 75, 138, 90, 45, 845, 618, 557, 886, 356, 888, 394, 505, 672, 289, 116, 60, 328, 532, 597, 848, 778, 546, 920, 797, 426, 261, 608, 196, 911, 52, 600, 997, 551, 614, 34, 949, 210, 137, 108, 707, 461, 984, 956, 463, 270, 337, 640, 8, 41, 942, 554, 412, 169, 527, 478, 743, 174, 406, 832, 601, 266, 113, 348, 889, 745, 117, 15, 37, 49, 453, 163, 937, 188, 9, 838, 144, 547, 411, 523, 735, 304, 479, 320, 182, 744, 299, 784, 989, 941, 668, 448, 661, 159, 508, 801, 946, 700, 274, 502, 856, 101, 464, 198, 143, 81, 374, 846, 915, 541, 105, 195, 436, 78, 610, 653, 525, 729, 861, 385, 12, 217, 91, 675, 509, 632, 543, 234, 42, 290, 301, 129, 876, 647, 646, 611, 179, 779, 421, 422, 214, 92, 313, 73, 149, 795, 606, 654, 787, 883, 378, 599, 555, 869, 977, 484, 990, 830, 362, 544, 907, 561, 676, 363, 388, 887, 940, 134, 130, 333, 626, 615, 88, 416, 583, 811, 928, 864, 150, 899, 855, 215, 519, 457, 227, 124, 763, 703, 194, 804, 396, 267, 438, 959, 31, 170, 842, 389, 250, 493, 538, 373, 147, 602, 471, 913, 395, 258, 562, 967, 998, 168, 531, 559, 450, 379, 753, 701, 516, 709, 774, 155, 558, 713, 927, 429, 460, 4, 458, 757, 173, 276, 746, 342, 428, 725, 973, 857, 863, 338, 822, 799, 878, 417, 834, 891, 576, 678, 929, 643, 156, 769, 398, 637, 349, 577, 968, 865, 693, 380, 994, 677, 764, 27, 433, 617, 708, 157, 325, 603, 760, 594, 13, 114, 240, 605, 344, 451, 187, 496, 473, 53, 604, 183, 789, 400, 489, 97, 446, 663, 384, 894, 688, 553, 467, 975, 782, 271, 82, 135, 345, 407, 814, 919, 322, 717, 74, 521, 736, 303, 794, 964, 148, 847, 825, 945, 884, 339, 239, 609, 697, 221, 279, 960, 213, 722, 21, 591, 111, 419, 987, 310, 329, 714, 343, 306, 474, 909, 522, 835, 106, 917, 792, 651, 305, 67, 197, 820, 630, 465, 882, 410, 319, 1, 254, 931, 986, 875, 770, 456, 524, 860, 208, 415, 723, 495, 3, 658, 443, 19, 657, 280, 393, 995, 284, 283, 852, 992, 263, 251, 635, 699, 690, 48, 910, 747, 868, 347, 165, 184, 816, 119, 512, 257, 666, 23, 730, 399, 28, 55, 761, 392, 831, 418, 826, 224, 86, 733, 391, 575, 427, 773, 737, 837, 6, 513, 287, 20, 755, 629, 308, 914, 649, 466, 685, 316, 582, 765, 359, 207, 58, 731, 963, 40, 622, 38, 71, 315, 167, 83, 401, 332, 361, 424, 225, 324, 514, 397, 947, 47, 719, 334, 459, 120, 341, 24, 535, 275, 30, 988, 872, 300, 958, 100, 638, 107, 29, 867, 123, 836, 587, 950, 912, 581, 827, 762, 235, 490, 953, 664, 802, 805, 375, 54, 260, 627, 785, 370, 536, 572, 367, 520, 297, 783, 534, 839, 734, 595, 255, 775, 249, 231, 728, 590, 386, 125, 439, 552, 644, 35, 633, 158, 574, 897, 954, 991, 800, 72, 435, 434, 472, 962, 69, 455, 768, 849, 943, 885, 641, 786, 922, 924, 492, 979, 482, 715, 758, 727, 126, 985, 64, 112, 272, 475, 311, 686, 22, 246, 592, 823, 803, 680, 751, 901, 61, 750, 808, 372, 506, 874, 494, 724, 667, 780, 238, 452, 616, 244, 469, 938, 323, 142, 613, 881, 759, 62, 11, 981, 281, 110, 978, 908, 704, 877, 153, 684, 68, 918, 230, 796, 563, 579, 955, 368, 193, 841, 721, 526, 454, 698, 98, 162, 423, 204, 957, 828, 588, 507, 220, 1000, 7, 936, 437, 584, 369, 777, 355, 624, 109, 862, 390, 612, 292, 245, 866, 77, 656, 497, 296, 14, 854, 961, 900, 209, 732, 314, 741, 273, 589, 95, 232, 662, 687, 926, 32, 625, 76, 621, 335, 517, 432, 175, 115, 976, 269, 190, 818, 634, 510, 336, 655, 233, 425, 821, 365, 483, 500, 216, 99, 36, 481, 351, 810, 548, 205, 350, 84, 352, 259, 161, 790, 923, 556, 330, 331, 670, 180, 133, 288, 185, 485, 965, 70, 726, 46, 80, 817, 278, 442, 50, 444, 136, 969, 903, 902, 772, 925, 895, 904, 268, 871, 189, 264, 262, 236, 122, 898, 488, 948, 619, 652, 833, 970, 952, 748, 873, 178, 252, 354, 51, 154, 906, 282, 752, 191, 403, 689, 982, 560, 930, 503, 242, 566, 648, 340, 771, 309, 360, 222, 691, 404, 537, 160, 650, 118, 573, 905, 636, 382, 413, 487, 939, 298, 934, 226, 504, 223, 476, 85, 248, 515, 441, 89, 702, 94, 449, 43, 302, 798, 285, 853, 326, 376, 694, 218, 166, 127, 228, 2, 381, 586, 212, 409, 18, 291, 659, 565, 739, 859, 716, 16, 570, 890, 518, 781, 201, 317, 540, 87, 420, 999, 139, 843, 132, 776, 5, 720 From eaebd42607a8046501baa01ef8804e4a46335684 Mon Sep 17 00:00:00 2001 From: Manuel Meraz Date: Wed, 11 Jan 2017 10:54:33 -0800 Subject: [PATCH 03/10] made testfiles --- challenge_10/testfiles/o1 | 1 + challenge_10/{tests/test1 => testfiles/t1} | 0 challenge_10/{tests/test2 => testfiles/t2} | 0 challenge_10/{tests/test3 => testfiles/t3} | 0 challenge_10/{tests/test4 => testfiles/t4} | 0 challenge_10/{tests/test5 => testfiles/t5} | 0 6 files changed, 1 insertion(+) create mode 100644 challenge_10/testfiles/o1 rename challenge_10/{tests/test1 => testfiles/t1} (100%) rename challenge_10/{tests/test2 => testfiles/t2} (100%) rename challenge_10/{tests/test3 => testfiles/t3} (100%) rename challenge_10/{tests/test4 => testfiles/t4} (100%) rename challenge_10/{tests/test5 => testfiles/t5} (100%) diff --git a/challenge_10/testfiles/o1 b/challenge_10/testfiles/o1 new file mode 100644 index 000000000..0ca95142b --- /dev/null +++ b/challenge_10/testfiles/o1 @@ -0,0 +1 @@ +True diff --git a/challenge_10/tests/test1 b/challenge_10/testfiles/t1 similarity index 100% rename from challenge_10/tests/test1 rename to challenge_10/testfiles/t1 diff --git a/challenge_10/tests/test2 b/challenge_10/testfiles/t2 similarity index 100% rename from challenge_10/tests/test2 rename to challenge_10/testfiles/t2 diff --git a/challenge_10/tests/test3 b/challenge_10/testfiles/t3 similarity index 100% rename from challenge_10/tests/test3 rename to challenge_10/testfiles/t3 diff --git a/challenge_10/tests/test4 b/challenge_10/testfiles/t4 similarity index 100% rename from challenge_10/tests/test4 rename to challenge_10/testfiles/t4 diff --git a/challenge_10/tests/test5 b/challenge_10/testfiles/t5 similarity index 100% rename from challenge_10/tests/test5 rename to challenge_10/testfiles/t5 From b911f4b90d8934486e6e682340fb944716238b5f Mon Sep 17 00:00:00 2001 From: Manuel Meraz Date: Wed, 11 Jan 2017 11:05:04 -0800 Subject: [PATCH 04/10] testfiles created --- challenge_10/README.md | 2 +- challenge_10/testfiles/o10 | 1 + challenge_10/testfiles/o11 | 1 + challenge_10/testfiles/o12 | 1 + challenge_10/testfiles/o13 | 1 + challenge_10/testfiles/o14 | 1 + challenge_10/testfiles/o2 | 1 + challenge_10/testfiles/o3 | 1 + challenge_10/testfiles/o4 | 1 + challenge_10/testfiles/o5 | 1 + challenge_10/testfiles/o6 | 1 + challenge_10/testfiles/o7 | 1 + challenge_10/testfiles/o8 | 1 + challenge_10/testfiles/o9 | 1 + challenge_10/testfiles/t10 | 1 + challenge_10/testfiles/t11 | 1 + challenge_10/testfiles/t12 | 1 + challenge_10/testfiles/t13 | 1 + challenge_10/testfiles/t14 | 1 + challenge_10/testfiles/t6 | 1 + challenge_10/testfiles/t7 | 1 + challenge_10/testfiles/t8 | 1 + challenge_10/testfiles/t9 | 1 + 23 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 challenge_10/testfiles/o10 create mode 100644 challenge_10/testfiles/o11 create mode 100644 challenge_10/testfiles/o12 create mode 100644 challenge_10/testfiles/o13 create mode 100644 challenge_10/testfiles/o14 create mode 100644 challenge_10/testfiles/o2 create mode 100644 challenge_10/testfiles/o3 create mode 100644 challenge_10/testfiles/o4 create mode 100644 challenge_10/testfiles/o5 create mode 100644 challenge_10/testfiles/o6 create mode 100644 challenge_10/testfiles/o7 create mode 100644 challenge_10/testfiles/o8 create mode 100644 challenge_10/testfiles/o9 create mode 100644 challenge_10/testfiles/t10 create mode 100644 challenge_10/testfiles/t11 create mode 100644 challenge_10/testfiles/t12 create mode 100644 challenge_10/testfiles/t13 create mode 100644 challenge_10/testfiles/t14 create mode 100644 challenge_10/testfiles/t6 create mode 100644 challenge_10/testfiles/t7 create mode 100644 challenge_10/testfiles/t8 create mode 100644 challenge_10/testfiles/t9 diff --git a/challenge_10/README.md b/challenge_10/README.md index b888a359d..3dd5ae621 100644 --- a/challenge_10/README.md +++ b/challenge_10/README.md @@ -9,7 +9,7 @@ Your solution should use a maximum of O(N) space and run in O(N) time (max). What is the best data structure for this problem? Please make your program so that it takes input from standard input. System.in for you java folks and input() for you pythonistas. -Testing +[Testing](https://github.com/YearOfProgramming/2017Challenges#testing) ------ Instead of describing each test case, I'm just going to list them out here since I'm sure you can imagine what they might be. diff --git a/challenge_10/testfiles/o10 b/challenge_10/testfiles/o10 new file mode 100644 index 000000000..0ca95142b --- /dev/null +++ b/challenge_10/testfiles/o10 @@ -0,0 +1 @@ +True diff --git a/challenge_10/testfiles/o11 b/challenge_10/testfiles/o11 new file mode 100644 index 000000000..0ca95142b --- /dev/null +++ b/challenge_10/testfiles/o11 @@ -0,0 +1 @@ +True diff --git a/challenge_10/testfiles/o12 b/challenge_10/testfiles/o12 new file mode 100644 index 000000000..0ca95142b --- /dev/null +++ b/challenge_10/testfiles/o12 @@ -0,0 +1 @@ +True diff --git a/challenge_10/testfiles/o13 b/challenge_10/testfiles/o13 new file mode 100644 index 000000000..bc59c12aa --- /dev/null +++ b/challenge_10/testfiles/o13 @@ -0,0 +1 @@ +False diff --git a/challenge_10/testfiles/o14 b/challenge_10/testfiles/o14 new file mode 100644 index 000000000..0ca95142b --- /dev/null +++ b/challenge_10/testfiles/o14 @@ -0,0 +1 @@ +True diff --git a/challenge_10/testfiles/o2 b/challenge_10/testfiles/o2 new file mode 100644 index 000000000..0ca95142b --- /dev/null +++ b/challenge_10/testfiles/o2 @@ -0,0 +1 @@ +True diff --git a/challenge_10/testfiles/o3 b/challenge_10/testfiles/o3 new file mode 100644 index 000000000..0ca95142b --- /dev/null +++ b/challenge_10/testfiles/o3 @@ -0,0 +1 @@ +True diff --git a/challenge_10/testfiles/o4 b/challenge_10/testfiles/o4 new file mode 100644 index 000000000..0ca95142b --- /dev/null +++ b/challenge_10/testfiles/o4 @@ -0,0 +1 @@ +True diff --git a/challenge_10/testfiles/o5 b/challenge_10/testfiles/o5 new file mode 100644 index 000000000..0ca95142b --- /dev/null +++ b/challenge_10/testfiles/o5 @@ -0,0 +1 @@ +True diff --git a/challenge_10/testfiles/o6 b/challenge_10/testfiles/o6 new file mode 100644 index 000000000..bc59c12aa --- /dev/null +++ b/challenge_10/testfiles/o6 @@ -0,0 +1 @@ +False diff --git a/challenge_10/testfiles/o7 b/challenge_10/testfiles/o7 new file mode 100644 index 000000000..0ca95142b --- /dev/null +++ b/challenge_10/testfiles/o7 @@ -0,0 +1 @@ +True diff --git a/challenge_10/testfiles/o8 b/challenge_10/testfiles/o8 new file mode 100644 index 000000000..bc59c12aa --- /dev/null +++ b/challenge_10/testfiles/o8 @@ -0,0 +1 @@ +False diff --git a/challenge_10/testfiles/o9 b/challenge_10/testfiles/o9 new file mode 100644 index 000000000..0ca95142b --- /dev/null +++ b/challenge_10/testfiles/o9 @@ -0,0 +1 @@ +True diff --git a/challenge_10/testfiles/t10 b/challenge_10/testfiles/t10 new file mode 100644 index 000000000..f193280c9 --- /dev/null +++ b/challenge_10/testfiles/t10 @@ -0,0 +1 @@ +[[[[[[[[[kafjalfeianfailfeja;fjai;efa;sfj]]]]]]]]]kjajdain diff --git a/challenge_10/testfiles/t11 b/challenge_10/testfiles/t11 new file mode 100644 index 000000000..cfc4083b9 --- /dev/null +++ b/challenge_10/testfiles/t11 @@ -0,0 +1 @@ +< blank > diff --git a/challenge_10/testfiles/t12 b/challenge_10/testfiles/t12 new file mode 100644 index 000000000..97d255669 --- /dev/null +++ b/challenge_10/testfiles/t12 @@ -0,0 +1 @@ +((((((fjdalfeja((((alefjalisj(())))))))))))d diff --git a/challenge_10/testfiles/t13 b/challenge_10/testfiles/t13 new file mode 100644 index 000000000..e354df97a --- /dev/null +++ b/challenge_10/testfiles/t13 @@ -0,0 +1 @@ +)))(((d diff --git a/challenge_10/testfiles/t14 b/challenge_10/testfiles/t14 new file mode 100644 index 000000000..fcb538a37 --- /dev/null +++ b/challenge_10/testfiles/t14 @@ -0,0 +1 @@ +({)} diff --git a/challenge_10/testfiles/t6 b/challenge_10/testfiles/t6 new file mode 100644 index 000000000..227b98e4a --- /dev/null +++ b/challenge_10/testfiles/t6 @@ -0,0 +1 @@ +{{{{{{{{{adfkjaefia}}}}}}} diff --git a/challenge_10/testfiles/t7 b/challenge_10/testfiles/t7 new file mode 100644 index 000000000..38ae55efc --- /dev/null +++ b/challenge_10/testfiles/t7 @@ -0,0 +1 @@ +{{{{{{{{{[[[[[[kadfa{{{{{{{((({daljfdaf({{{[]}}kaldjfs})})))}}}}}}}]]]]]]}kjfela}}}}}}}} diff --git a/challenge_10/testfiles/t8 b/challenge_10/testfiles/t8 new file mode 100644 index 000000000..18f7b56d4 --- /dev/null +++ b/challenge_10/testfiles/t8 @@ -0,0 +1 @@ +{{{[}}}}dafda diff --git a/challenge_10/testfiles/t9 b/challenge_10/testfiles/t9 new file mode 100644 index 000000000..307f7a70c --- /dev/null +++ b/challenge_10/testfiles/t9 @@ -0,0 +1 @@ +{{{{{{{{{}}}}}}}}} From 67d99e5e78dce2031b4bb3332813775d2281355f Mon Sep 17 00:00:00 2001 From: Manuel Meraz Date: Wed, 11 Jan 2017 11:31:43 -0800 Subject: [PATCH 05/10] solution --- _bin/test | 1 + challenge_10/cpp/manuel/Makefile | 33 +++++++++++++++ challenge_10/cpp/manuel/README.md | 24 +++++++++++ challenge_10/cpp/manuel/src/include/tools.h | 11 +++++ challenge_10/cpp/manuel/src/main.cpp | 20 +++++++++ challenge_10/cpp/manuel/src/tools.cpp | 46 +++++++++++++++++++++ challenge_10/cpp/manuel/test | 1 + 7 files changed, 136 insertions(+) create mode 100644 challenge_10/cpp/manuel/Makefile create mode 100644 challenge_10/cpp/manuel/README.md create mode 100644 challenge_10/cpp/manuel/src/include/tools.h create mode 100644 challenge_10/cpp/manuel/src/main.cpp create mode 100644 challenge_10/cpp/manuel/src/tools.cpp create mode 100644 challenge_10/cpp/manuel/test diff --git a/_bin/test b/_bin/test index 2ed3f0db4..42224cf26 100755 --- a/_bin/test +++ b/_bin/test @@ -91,6 +91,7 @@ for input in $test_dir/t*; do diff user_result $test_dir/o$count > comparison if [[ -s comparison ]] ; then + cat comparison echo "Incorrect for $count th example."; else echo "Correct for $count th example."; diff --git a/challenge_10/cpp/manuel/Makefile b/challenge_10/cpp/manuel/Makefile new file mode 100644 index 000000000..f9c2b5238 --- /dev/null +++ b/challenge_10/cpp/manuel/Makefile @@ -0,0 +1,33 @@ +SRC := $(wildcard src/*.cpp) +HEADERS := $(wildcard $(addprefix src/include/, *.h)) + +OBJDIR := obj +BINDIR := bin +OBJECTS := $(addprefix $(OBJDIR)/, $(notdir src/ $(SRC:.cpp=.o))) + +EXE := solution.exe +CC := g++ +CFLAGS := -Wall -c -std=c++11 +LFLAGS := -Wall + +$(EXE) : $(BINDIR) $(OBJDIR) $(OBJECTS) + @$(CC) $(LFLAGS) -o $(BINDIR)/$@ $(OBJECTS) + +obj/%.o : src/%.cpp $(HEADERS) + @$(CC) $(CFLAGS) -o $@ $< + +.PHONY : clean test $(BINDIR) $(OBJDIR) + +clean : + @rm -rf $(BINDIR) $(OBJDIR) + +test: + @cd ../../../;\ + ./_bin/test 10 cpp manuel;\ + cd challenge_10/cpp/manuel/;\ + +$(BINDIR) : + @mkdir -p $(BINDIR) + +$(OBJDIR) : + @mkdir -p $(OBJDIR) diff --git a/challenge_10/cpp/manuel/README.md b/challenge_10/cpp/manuel/README.md new file mode 100644 index 000000000..5261ff4c2 --- /dev/null +++ b/challenge_10/cpp/manuel/README.md @@ -0,0 +1,24 @@ +# Challenge Name +###### C++11 @manuel + +### 1. Approch to Solving the problem + +Given a set of numbers ranging from 0 to N-1 with one missing number, +then the largest number in that set is the length of the array. + +If we find the sum of N + (N-1) + (N - 2) + ... + (N - N) = N * (N + 1) / 2, +and then iterate through the given set and subtract this value, once we +reach the end of the array the difference will be the missing number. + +### 2. How to compile and run this code + +``` +make +make test +make clean +``` + +### 3. How this program works + +Single line of input -> Single line of output + 1,3,4,0 -> 2 diff --git a/challenge_10/cpp/manuel/src/include/tools.h b/challenge_10/cpp/manuel/src/include/tools.h new file mode 100644 index 000000000..99caa9de5 --- /dev/null +++ b/challenge_10/cpp/manuel/src/include/tools.h @@ -0,0 +1,11 @@ +#ifndef TOOLS_H +#define TOOLS_H + +namespace tools { + + std::map count(std::string); + bool verify_closers(std::map); + +} + +#endif diff --git a/challenge_10/cpp/manuel/src/main.cpp b/challenge_10/cpp/manuel/src/main.cpp new file mode 100644 index 000000000..9a28be8c0 --- /dev/null +++ b/challenge_10/cpp/manuel/src/main.cpp @@ -0,0 +1,20 @@ +#include +#include +#include + +#include "include/tools.h" + +int main(int argc, char **argv) { + + std::string input; + std::getline(std::cin, input); + + std::map counter = tools::count(input); + if (tools::verify_closers(counter)) { + std::cout << "True" << std::endl; + } else { + std::cout << "False" << std::endl; + } + + return 0; +} diff --git a/challenge_10/cpp/manuel/src/tools.cpp b/challenge_10/cpp/manuel/src/tools.cpp new file mode 100644 index 000000000..b4feaf0ba --- /dev/null +++ b/challenge_10/cpp/manuel/src/tools.cpp @@ -0,0 +1,46 @@ +#include +#include + +#include "include/tools.h" + +std::map tools::count (std::string input) { + + std::map counter; + int length = input.length(); + + for(int i = 0; i < length; i++) { + if(input[i] == '(' || input[i] == '{' || input[i] == '[' || input[i] == '<') { + // count all the openers + counter[input[i]]++; + + // count the closers + } else if(input[i] == ')') { + counter['(']--; + } else if(input[i] == '}') { + counter['{']--; + } else if(input[i] == ']') { + counter['[']--; + } else if(input[i] == '<') { + counter['<']--; + } + + if(counter[input[i]] < 0) { + // If there are more closers than + // openers, this is false + + counter.clear(); + return counter; + } + } + + return counter; +} + +bool tools::verify_closers(std::map counter) { + + if(counter['{'] != 0 || counter['('] != 0 || counter['['] != 0 || counter.empty()) { + return false; + } + + else return true; +} diff --git a/challenge_10/cpp/manuel/test b/challenge_10/cpp/manuel/test new file mode 100644 index 000000000..bc59c12aa --- /dev/null +++ b/challenge_10/cpp/manuel/test @@ -0,0 +1 @@ +False From aaa9c2f12d0a20ba5493d84bd65bdda532972217 Mon Sep 17 00:00:00 2001 From: Manuel Meraz Date: Wed, 11 Jan 2017 11:52:15 -0800 Subject: [PATCH 06/10] fixed testfiles --- challenge_10/testfiles/o10 | 1 - challenge_10/testfiles/o11 | 1 - challenge_10/testfiles/o12 | 1 - challenge_10/testfiles/o13 | 1 - challenge_10/testfiles/o14 | 1 - challenge_10/testfiles/t10 | 1 - challenge_10/testfiles/t11 | 1 - challenge_10/testfiles/t12 | 1 - challenge_10/testfiles/t13 | 1 - challenge_10/testfiles/t14 | 1 - 10 files changed, 10 deletions(-) delete mode 100644 challenge_10/testfiles/o10 delete mode 100644 challenge_10/testfiles/o11 delete mode 100644 challenge_10/testfiles/o12 delete mode 100644 challenge_10/testfiles/o13 delete mode 100644 challenge_10/testfiles/o14 delete mode 100644 challenge_10/testfiles/t10 delete mode 100644 challenge_10/testfiles/t11 delete mode 100644 challenge_10/testfiles/t12 delete mode 100644 challenge_10/testfiles/t13 delete mode 100644 challenge_10/testfiles/t14 diff --git a/challenge_10/testfiles/o10 b/challenge_10/testfiles/o10 deleted file mode 100644 index 0ca95142b..000000000 --- a/challenge_10/testfiles/o10 +++ /dev/null @@ -1 +0,0 @@ -True diff --git a/challenge_10/testfiles/o11 b/challenge_10/testfiles/o11 deleted file mode 100644 index 0ca95142b..000000000 --- a/challenge_10/testfiles/o11 +++ /dev/null @@ -1 +0,0 @@ -True diff --git a/challenge_10/testfiles/o12 b/challenge_10/testfiles/o12 deleted file mode 100644 index 0ca95142b..000000000 --- a/challenge_10/testfiles/o12 +++ /dev/null @@ -1 +0,0 @@ -True diff --git a/challenge_10/testfiles/o13 b/challenge_10/testfiles/o13 deleted file mode 100644 index bc59c12aa..000000000 --- a/challenge_10/testfiles/o13 +++ /dev/null @@ -1 +0,0 @@ -False diff --git a/challenge_10/testfiles/o14 b/challenge_10/testfiles/o14 deleted file mode 100644 index 0ca95142b..000000000 --- a/challenge_10/testfiles/o14 +++ /dev/null @@ -1 +0,0 @@ -True diff --git a/challenge_10/testfiles/t10 b/challenge_10/testfiles/t10 deleted file mode 100644 index f193280c9..000000000 --- a/challenge_10/testfiles/t10 +++ /dev/null @@ -1 +0,0 @@ -[[[[[[[[[kafjalfeianfailfeja;fjai;efa;sfj]]]]]]]]]kjajdain diff --git a/challenge_10/testfiles/t11 b/challenge_10/testfiles/t11 deleted file mode 100644 index cfc4083b9..000000000 --- a/challenge_10/testfiles/t11 +++ /dev/null @@ -1 +0,0 @@ -< blank > diff --git a/challenge_10/testfiles/t12 b/challenge_10/testfiles/t12 deleted file mode 100644 index 97d255669..000000000 --- a/challenge_10/testfiles/t12 +++ /dev/null @@ -1 +0,0 @@ -((((((fjdalfeja((((alefjalisj(())))))))))))d diff --git a/challenge_10/testfiles/t13 b/challenge_10/testfiles/t13 deleted file mode 100644 index e354df97a..000000000 --- a/challenge_10/testfiles/t13 +++ /dev/null @@ -1 +0,0 @@ -)))(((d diff --git a/challenge_10/testfiles/t14 b/challenge_10/testfiles/t14 deleted file mode 100644 index fcb538a37..000000000 --- a/challenge_10/testfiles/t14 +++ /dev/null @@ -1 +0,0 @@ -({)} From 787616028ff59c9de655089d3a6eb98e7d686865 Mon Sep 17 00:00:00 2001 From: Manuel Meraz Date: Wed, 11 Jan 2017 11:58:02 -0800 Subject: [PATCH 07/10] challenge 10 completed --- challenge_10/cpp/manuel/README.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/challenge_10/cpp/manuel/README.md b/challenge_10/cpp/manuel/README.md index 5261ff4c2..bcf84f48d 100644 --- a/challenge_10/cpp/manuel/README.md +++ b/challenge_10/cpp/manuel/README.md @@ -1,14 +1,20 @@ -# Challenge Name +# Valid Closers ###### C++11 @manuel ### 1. Approch to Solving the problem -Given a set of numbers ranging from 0 to N-1 with one missing number, -then the largest number in that set is the length of the array. +To solve this challenge I used a map to count the closers. -If we find the sum of N + (N-1) + (N - 2) + ... + (N - N) = N * (N + 1) / 2, -and then iterate through the given set and subtract this value, once we -reach the end of the array the difference will be the missing number. +If we had a left bracket we incremented the map to it by one. + +If we had a right bracket, we decremented the map to the corresponding +left bracket by one. + +If at any point, the counter fell below 0, then there was a right +bracket without a corresponding left bracket and the test was False; + +At the end of all the keys returna a value of 0, then all the brackets +were closed. ### 2. How to compile and run this code @@ -21,4 +27,3 @@ make clean ### 3. How this program works Single line of input -> Single line of output - 1,3,4,0 -> 2 From 10cad72a870dcdf4c3c0129cdc97e3c01fd33f81 Mon Sep 17 00:00:00 2001 From: Manuel Meraz Date: Wed, 11 Jan 2017 12:03:21 -0800 Subject: [PATCH 08/10] modified testfile --- _bin/test | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/_bin/test b/_bin/test index 42224cf26..e2f970f96 100755 --- a/_bin/test +++ b/_bin/test @@ -91,8 +91,10 @@ for input in $test_dir/t*; do diff user_result $test_dir/o$count > comparison if [[ -s comparison ]] ; then - cat comparison + echo "----------------------------" echo "Incorrect for $count th example."; + cat comparison + echo "----------------------------" else echo "Correct for $count th example."; let corr++ From 9bbed5ac658df0c816dce48a0949efa3f9c21d72 Mon Sep 17 00:00:00 2001 From: Manuel Meraz Date: Wed, 11 Jan 2017 12:04:27 -0800 Subject: [PATCH 09/10] removed junk file --- challenge_10/cpp/manuel/test | 1 - 1 file changed, 1 deletion(-) delete mode 100644 challenge_10/cpp/manuel/test diff --git a/challenge_10/cpp/manuel/test b/challenge_10/cpp/manuel/test deleted file mode 100644 index bc59c12aa..000000000 --- a/challenge_10/cpp/manuel/test +++ /dev/null @@ -1 +0,0 @@ -False From 5c24422ed4dc5aab95eb051cbece5c16717f7492 Mon Sep 17 00:00:00 2001 From: Manuel Meraz Date: Wed, 11 Jan 2017 15:38:39 -0800 Subject: [PATCH 10/10] fixed bug in code --- challenge_10/cpp/manuel/src/tools.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/challenge_10/cpp/manuel/src/tools.cpp b/challenge_10/cpp/manuel/src/tools.cpp index b4feaf0ba..8045a8315 100644 --- a/challenge_10/cpp/manuel/src/tools.cpp +++ b/challenge_10/cpp/manuel/src/tools.cpp @@ -20,13 +20,12 @@ std::map tools::count (std::string input) { counter['{']--; } else if(input[i] == ']') { counter['[']--; - } else if(input[i] == '<') { + } else if(input[i] == '>') { counter['<']--; } - if(counter[input[i]] < 0) { - // If there are more closers than - // openers, this is false + if(counter['('] < 0 || counter['{'] < 0 || counter['['] < 0 || counter['<'] < 0) { + // Right side closer without a pair counter.clear(); return counter; @@ -38,9 +37,9 @@ std::map tools::count (std::string input) { bool tools::verify_closers(std::map counter) { - if(counter['{'] != 0 || counter['('] != 0 || counter['['] != 0 || counter.empty()) { + if(counter.empty() || counter ['<'] != 0 || counter['{'] != 0 || counter['('] != 0 || counter['['] != 0 ) { return false; } - else return true; + return true; }