aboutsummaryrefslogtreecommitdiff
path: root/challenge-262/asherbhs/apl
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-262/asherbhs/apl')
-rw-r--r--challenge-262/asherbhs/apl/ch-1.apl5
-rw-r--r--challenge-262/asherbhs/apl/ch-2.apl6
2 files changed, 11 insertions, 0 deletions
diff --git a/challenge-262/asherbhs/apl/ch-1.apl b/challenge-262/asherbhs/apl/ch-1.apl
new file mode 100644
index 0000000000..63974de53f
--- /dev/null
+++ b/challenge-262/asherbhs/apl/ch-1.apl
@@ -0,0 +1,5 @@
+MaxPositiveNegative←{⌈/+/1 ¯1∘.=×⍵}
+
+⎕←MaxPositiveNegative ¯3 1 2 ¯1 3 ¯2 4
+⎕←MaxPositiveNegative ¯1 ¯2 ¯3 1
+⎕←MaxPositiveNegative 1 2
diff --git a/challenge-262/asherbhs/apl/ch-2.apl b/challenge-262/asherbhs/apl/ch-2.apl
new file mode 100644
index 0000000000..b17cd9bee1
--- /dev/null
+++ b/challenge-262/asherbhs/apl/ch-2.apl
@@ -0,0 +1,6 @@
+⎕IO←0
+
+CountEqualDivisible←{+/,(∘.=⍨⍵)∧(∘.(0=⍺|×)∧∘.<)⍨⍳≢⍵}
+
+⎕←2 CountEqualDivisible 3 1 2 2 2 1 3
+⎕←1 CountEqualDivisible 1 2 3