aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad S Anwar <Mohammad.Anwar@yahoo.com>2020-08-20 13:46:48 +0100
committerGitHub <noreply@github.com>2020-08-20 13:46:48 +0100
commitfd0dc55cb87d7c5bdb3fac7380826a273f5e5ceb (patch)
treec0cc9e68ab96b8dfda2fafd320dbdec56be50ef6
parent41f889c8b174cb05b173c458036a50764b420d82 (diff)
parente88f016f5a9c9302316234cb0df62fa8291cd4e3 (diff)
downloadperlweeklychallenge-club-fd0dc55cb87d7c5bdb3fac7380826a273f5e5ceb.tar.gz
perlweeklychallenge-club-fd0dc55cb87d7c5bdb3fac7380826a273f5e5ceb.tar.bz2
perlweeklychallenge-club-fd0dc55cb87d7c5bdb3fac7380826a273f5e5ceb.zip
Merge pull request #2112 from jeongoon/master
[ch-074/jeongoon] Perl and Raku solution sligthly modified
-rw-r--r--challenge-074/jeongoon/perl/ch-2.pl2
-rw-r--r--challenge-074/jeongoon/raku/ch-2.raku2
2 files changed, 2 insertions, 2 deletions
diff --git a/challenge-074/jeongoon/perl/ch-2.pl b/challenge-074/jeongoon/perl/ch-2.pl
index 251885f8d9..1758963be6 100644
--- a/challenge-074/jeongoon/perl/ch-2.pl
+++ b/challenge-074/jeongoon/perl/ch-2.pl
@@ -11,10 +11,10 @@ sub uniq_sorted {
sub printLNR ($) {
my $str = shift;
- my @candi = uniq_sorted( split '', $str );
for my $last_idx ( 1 .. length $str ) {
my $sub_chars = substr $str, 0, $last_idx;
+ my @candi = uniq_sorted( split '', $sub_chars );
my $nr_pos = -1;
my $nr_chr = '#';
diff --git a/challenge-074/jeongoon/raku/ch-2.raku b/challenge-074/jeongoon/raku/ch-2.raku
index fba9030909..ab03aa5e41 100644
--- a/challenge-074/jeongoon/raku/ch-2.raku
+++ b/challenge-074/jeongoon/raku/ch-2.raku
@@ -8,10 +8,10 @@ use v6.d;
role fnr {
method sayLNR ( Str:D $str = self.Str ) {
my @chars = $str.comb;
- my @candi = @chars.unique;
for 1 .. @chars.elems -> $last-index {
my $sub-chars = $str.substr( 0, $last-index );
+ my @candi = @sub-chars.unique;
my $nr-pos = -1;
my $nr-char = '#';
for @candi -> $c {