diff options
Diffstat (limited to 'challenge-243/packy-anderson/README.md')
| -rw-r--r-- | challenge-243/packy-anderson/README.md | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/challenge-243/packy-anderson/README.md b/challenge-243/packy-anderson/README.md index 1789b5db95..ff23846b2d 100644 --- a/challenge-243/packy-anderson/README.md +++ b/challenge-243/packy-anderson/README.md @@ -8,19 +8,19 @@ Sample output ``` $ raku/ch-1.raku Example 1: -Input: @arr1 = (1, 2, 3) - @arr2 = (2, 4, 6) -Output: ([1, 3], [4, 6]) +Input: @nums = (1, 3, 2, 3, 1) +Output: 2 + +(1, 4) => nums[1] = 3, nums[4] = 1, 3 > 2 * 1 +(3, 4) => nums[3] = 3, nums[4] = 1, 3 > 2 * 1 -(1, 2, 3) has 2 members (1, 3) missing from the array (2, 4, 6) -(2, 4, 6) has 2 members (4, 6) missing from the array (1, 2, 3) Example 2: -Input: @arr1 = (1, 2, 3, 3) - @arr2 = (1, 1, 2, 2) -Output: ([3]) +Input: @nums = (2, 4, 3, 5, 1) +Output: 3 -(1, 2, 3, 3) has 2 members (3, 3) missing from the array (1, 1, 2, 2) -(1, 1, 2, 2) has 0 members missing from the array (1, 2, 3, 3) +(1, 4) => nums[1] = 4, nums[4] = 1, 4 > 2 * 1 +(2, 4) => nums[2] = 3, nums[4] = 1, 3 > 2 * 1 +(3, 4) => nums[3] = 5, nums[4] = 1, 5 > 2 * 1 ``` * [Task 2](raku/ch-2.raku) @@ -29,12 +29,12 @@ Sample output ``` $ raku/ch-2.raku Example 1: -Input: @matrix = ([1, 1, 0], [1, 0, 1], [0, 0, 0]) -Output: ([1, 0, 0], [0, 1, 0], [1, 1, 1]) +Input: @nums = (2, 5, 9) +Output: 10 Example 2: -Input: @matrix = ([1, 1, 0, 0], [1, 0, 0, 1], [0, 1, 1, 1], [1, 0, 1, 0]) -Output: ([1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 0, 1], [1, 0, 1, 0]) +Input: @nums = (7, 7, 7, 7, 7, 7, 7) +Output: 49 ``` ## Perl @@ -45,19 +45,19 @@ Sample output ``` $ perl/ch-1.pl Example 1: -Input: @arr1 = (1, 2, 3) - @arr2 = (2, 4, 6) -Output: ([1, 3], [4, 6]) +Input: @nums = (1, 3, 2, 3, 1) +Output: 2 + +(1, 4) => nums[1] = 3, nums[4] = 1, 3 > 2 * 1 +(3, 4) => nums[3] = 3, nums[4] = 1, 3 > 2 * 1 -(1, 2, 3) has 2 members (1, 3) missing from the array (2, 4, 6) -(2, 4, 6) has 2 members (4, 6) missing from the array (1, 2, 3) Example 2: -Input: @arr1 = (1, 2, 3, 3) - @arr2 = (1, 1, 2, 2) -Output: ([3]) +Input: @nums = (2, 4, 3, 5, 1) +Output: 3 -(1, 2, 3, 3) has 2 members (3, 3) missing from the array (1, 1, 2, 2) -(1, 1, 2, 2) has 0 members missing from the array (1, 2, 3, 3) +(1, 4) => nums[1] = 4, nums[4] = 1, 4 > 2 * 1 +(2, 4) => nums[2] = 3, nums[4] = 1, 3 > 2 * 1 +(3, 4) => nums[3] = 5, nums[4] = 1, 5 > 2 * 1 ``` * [Task 2](perl/ch-2.pl) @@ -66,12 +66,12 @@ Sample output ``` $ perl/ch-2.pl Example 1: -Input: @matrix = ([1, 1, 0], [1, 0, 1], [0, 0, 0]) -Output: ([1, 0, 0], [0, 1, 0], [1, 1, 1]) +Input: @nums = (2, 5, 9) +Output: 10 Example 2: -Input: @matrix = ([1, 1, 0, 0], [1, 0, 0, 1], [0, 1, 1, 1], [1, 0, 1, 0]) -Output: ([1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 0, 1], [1, 0, 1, 0]) +Input: @nums = (7, 7, 7, 7, 7, 7, 7) +Output: 49 ``` ## Guest Language: Python @@ -80,4 +80,4 @@ Output: ([1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 0, 1], [1, 0, 1, 0]) ## Blog Post -[Perl Weekly Challenge: Flip the Missing Matrix Members](https://packy.dardan.com/2023/11/05/perl-weekly-challenge-flip-the-missing-matrix-members/) +[Perl Weekly Challenge: Three of a Reverse Sum Pair](https://packy.dardan.com/b/E5) |
