aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFung Cheok Yin <61836418+E7-87-83@users.noreply.github.com>2020-06-14 21:50:58 +0800
committerGitHub <noreply@github.com>2020-06-14 21:50:58 +0800
commitf280c6653fc871b4437f50f1547d7abe8312f961 (patch)
treee78b3337ee104e21f8945952b5fd91581a11c23e
parent85bc235d9c6a86f9422e4c67c92359e2e777d3b7 (diff)
downloadperlweeklychallenge-club-f280c6653fc871b4437f50f1547d7abe8312f961.tar.gz
perlweeklychallenge-club-f280c6653fc871b4437f50f1547d7abe8312f961.tar.bz2
perlweeklychallenge-club-f280c6653fc871b4437f50f1547d7abe8312f961.zip
Update ch-2.pl
1. modify the default test case in order to have a positive output 2. add "Usage" in comments
-rw-r--r--challenge-064/cheok-yin-fung/perl/ch-2.pl7
1 files changed, 5 insertions, 2 deletions
diff --git a/challenge-064/cheok-yin-fung/perl/ch-2.pl b/challenge-064/cheok-yin-fung/perl/ch-2.pl
index 2c04455b3a..72d3946bdd 100644
--- a/challenge-064/cheok-yin-fung/perl/ch-2.pl
+++ b/challenge-064/cheok-yin-fung/perl/ch-2.pl
@@ -3,6 +3,9 @@ use strict;
use Math::Combinatorics;
use List::Util qw{sum};
+# Usage:
+# Example Input: $ perl ch-2.pl perlweeklychallenge weekly challenge perl
+# Output: "perl","weekly","challenge"
#ref Challenge-051 task-1 3 Sum
#brute force
@@ -13,8 +16,8 @@ my $S;
my @W;
if ($ARGV[0] eq undef) {
- $S = "thequickbrownfoxjumpsoverthelazydogwooyousee";
- @W = split / /, "theq uickb rownf ox jumps over the lazy dog";
+ $S = "thequickbrownfoxjumpsoverthelazydogwoo";
+ @W = split / /, "theq uickb rownf ox jumps over the lazy dog woo";
} else {
$S = shift @ARGV;
@W = @ARGV;