aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-217/steve-g-lynn/blog.txt1
-rwxr-xr-xchallenge-217/steve-g-lynn/perl/ch-1.pdl6
-rwxr-xr-xchallenge-217/steve-g-lynn/perl/ch-2.pl14
3 files changed, 21 insertions, 0 deletions
diff --git a/challenge-217/steve-g-lynn/blog.txt b/challenge-217/steve-g-lynn/blog.txt
new file mode 100644
index 0000000000..e0478b00df
--- /dev/null
+++ b/challenge-217/steve-g-lynn/blog.txt
@@ -0,0 +1 @@
+https://thiujiac.blogspot.com/2023/05/pwc-217.html
diff --git a/challenge-217/steve-g-lynn/perl/ch-1.pdl b/challenge-217/steve-g-lynn/perl/ch-1.pdl
new file mode 100755
index 0000000000..c60ddbaa11
--- /dev/null
+++ b/challenge-217/steve-g-lynn/perl/ch-1.pdl
@@ -0,0 +1,6 @@
+#!/usr/bin/pdl
+
+sub sorted_matrix {my ($pdl)=@_; $pdl=$pdl->flat->qsort; $pdl(2);}
+p &sorted_matrix( pdl '[3,1,2; 5,2,4; 0,1,3]' ); #-- [1]
+p &sorted_matrix( pdl '[2,1; 4,5]' ); #-- [4]
+p &sorted_matrix( pdl '[1,0,3; 0,0,0; 1,2,1]' ); #--[0]
diff --git a/challenge-217/steve-g-lynn/perl/ch-2.pl b/challenge-217/steve-g-lynn/perl/ch-2.pl
new file mode 100755
index 0000000000..8cc90c75d4
--- /dev/null
+++ b/challenge-217/steve-g-lynn/perl/ch-2.pl
@@ -0,0 +1,14 @@
+#!/usr/bin/env -S perl -wl
+
+
+sub max_number {
+ my (@list)=@_;
+ join '', sort { $b.$a <=> $a.$b } @list;
+}
+
+print &max_number( 1,23 ); #--231
+print &max_number( 10,3,2 ); #--3210
+print &max_number( 31,2,4,10 ); #-- 431210
+print &max_number( 5,11,4,1,2 ); #-- 542111
+print &max_number( 1,10 ); #-- 110
+