aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad Sajid Anwar <Mohammad.Anwar@yahoo.com>2025-10-27 23:12:38 +0000
committerGitHub <noreply@github.com>2025-10-27 23:12:38 +0000
commitcf67a6a55831ea89966067fbf51eda1eba8bdd11 (patch)
tree595c7d736f49db6b66367dbb9311c8ea1e260ddc
parent76cb55b9ce411d48526325a8b6d8ee179d42b723 (diff)
parent7c9c3d15c984e2b73d75304005408f57ba3700a4 (diff)
downloadperlweeklychallenge-club-cf67a6a55831ea89966067fbf51eda1eba8bdd11.tar.gz
perlweeklychallenge-club-cf67a6a55831ea89966067fbf51eda1eba8bdd11.tar.bz2
perlweeklychallenge-club-cf67a6a55831ea89966067fbf51eda1eba8bdd11.zip
Merge pull request #12937 from codereport/master
✨ Additional 307 Solutions
-rw-r--r--challenge-307/conor-hoekstra/apl/ch-1.apl1
-rw-r--r--challenge-307/conor-hoekstra/cuda/ch-1.cu5
-rw-r--r--challenge-307/conor-hoekstra/python/ch-1.py11
3 files changed, 17 insertions, 0 deletions
diff --git a/challenge-307/conor-hoekstra/apl/ch-1.apl b/challenge-307/conor-hoekstra/apl/ch-1.apl
new file mode 100644
index 0000000000..53a183db51
--- /dev/null
+++ b/challenge-307/conor-hoekstra/apl/ch-1.apl
@@ -0,0 +1 @@
+CheckOrder ← 1-⍨⍸(⊂⍤⍋⍛⌷)⍛≠ \ No newline at end of file
diff --git a/challenge-307/conor-hoekstra/cuda/ch-1.cu b/challenge-307/conor-hoekstra/cuda/ch-1.cu
new file mode 100644
index 0000000000..ecab913a08
--- /dev/null
+++ b/challenge-307/conor-hoekstra/cuda/ch-1.cu
@@ -0,0 +1,5 @@
+#import "parrot.h"
+
+auto check_order(auto ints) { //
+ return ints.sort().neq(ints).where() - 1;
+} \ No newline at end of file
diff --git a/challenge-307/conor-hoekstra/python/ch-1.py b/challenge-307/conor-hoekstra/python/ch-1.py
new file mode 100644
index 0000000000..86d10de038
--- /dev/null
+++ b/challenge-307/conor-hoekstra/python/ch-1.py
@@ -0,0 +1,11 @@
+import numpy as np
+
+
+def check_order(lst):
+ return [c for c, (a, b) in enumerate(zip(lst, sorted(lst))) if a != b]
+
+
+# NumPy Solution
+def check_order_np(lst):
+ l = np.array(lst)
+ return np.where(l != sorted(l))[0]