diff options
Diffstat (limited to 'challenge-203')
125 files changed, 5283 insertions, 97 deletions
diff --git a/challenge-203/0rir/raku/ch-1.raku b/challenge-203/0rir/raku/ch-1.raku new file mode 100755 index 0000000000..451d575e14 --- /dev/null +++ b/challenge-203/0rir/raku/ch-1.raku @@ -0,0 +1,117 @@ +#!/usr/bin/env raku +# :vim ft=raku sw=4 expandtab # 🦋 ∅ ≡ ∩ ≢ ∈ «  » ∴ +use v6.e.PREVIEW; +use lib $?FILE.IO.parent(2).add("lib"); +use Test; +use Array::Sorted::Util; + +=begin comment +203-1: Special Quadruplets Submitted by: Mohammad S Anwar +Given an array of integers, find the total special quadruplets for the array. + +Special Quadruplets are defined by the following 2 rules. +1) nums[a] + nums[b] + nums[c] == nums[d] +2) a < b < c < d + +Example 1 +Input: @nums = (1,2,3,6) +Output: 1 + +Since the only special quadruplets found is $nums[0] + $nums[1] + $nums[2] == $nums[3]. +Example 2 +Input: @nums = (1,1,1,3,5) +Output: 4 + +$nums[0] + $nums[1] + $nums[2] == $nums[3] +$nums[0] + $nums[1] + $nums[3] == $nums[4] +$nums[0] + $nums[2] + $nums[3] == $nums[4] +$nums[1] + $nums[2] + $nums[3] == $nums[4] +Example 3 +Input: @nums = (3,3,6,4,5) +Output: 0 + +=end comment + +=begin comment + +=end comment + +my @Test = + [] => [], + [1,] => [], + [1,2] => [], + [1,2,3] => [], + [1,2,3,4] => [], + + |
