aboutsummaryrefslogtreecommitdiff
path: root/challenge-243/packy-anderson/README.md
blob: ff23846b2dd509b2e2749055706bffcc0bd12155 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Solutions by Packy Anderson

## Raku

* [Task 1](raku/ch-1.raku)

Sample output
```
$ raku/ch-1.raku
Example 1:
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

Example 2:
Input: @nums = (2, 4, 3, 5, 1)
Output: 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)

Sample output
```
$ raku/ch-2.raku
Example 1:
Input: @nums = (2, 5, 9)
Output: 10

Example 2:
Input: @nums = (7, 7, 7, 7, 7, 7, 7)
Output: 49
```

## Perl

* [Task 1](perl/ch-1.pl)

Sample output
```
$ perl/ch-1.pl
Example 1:
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

Example 2:
Input: @nums = (2, 4, 3, 5, 1)
Output: 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)

Sample output
```
$ perl/ch-2.pl
Example 1:
Input: @nums = (2, 5, 9)
Output: 10

Example 2:
Input: @nums = (7, 7, 7, 7, 7, 7, 7)
Output: 49
```

## Guest Language: Python
* [Task 1](python/ch-1.py)
* [Task 2](python/ch-2.py)

## Blog Post

[Perl Weekly Challenge: Three of a Reverse Sum Pair](https://packy.dardan.com/b/E5)