aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrir <rirans@comcast.net>2024-08-08 11:21:06 -0400
committerrir <rirans@comcast.net>2024-08-08 11:21:06 -0400
commit081f6f3e6a200e01c7f7060c9e78dea436a7b296 (patch)
treed459b4b344f1d2b23ea8223cee8740d9122e3b38
parent039db27e578c2d6795ff912ad9db80b99d9f93b8 (diff)
downloadperlweeklychallenge-club-081f6f3e6a200e01c7f7060c9e78dea436a7b296.tar.gz
perlweeklychallenge-club-081f6f3e6a200e01c7f7060c9e78dea436a7b296.tar.bz2
perlweeklychallenge-club-081f6f3e6a200e01c7f7060c9e78dea436a7b296.zip
280 touch up
-rw-r--r--challenge-280/0rir/raku/ch-1.raku8
-rw-r--r--challenge-280/0rir/raku/ch-2.raku3
2 files changed, 5 insertions, 6 deletions
diff --git a/challenge-280/0rir/raku/ch-1.raku b/challenge-280/0rir/raku/ch-1.raku
index be79984f82..fae36bf020 100644
--- a/challenge-280/0rir/raku/ch-1.raku
+++ b/challenge-280/0rir/raku/ch-1.raku
@@ -4,7 +4,7 @@ use v6.d;
use Test;
=begin comment
-280 1: Twice Appearance Submitted by: Mohammad Sajid Anwar
+280-1: Twice Appearance Submitted by: Mohammad Sajid Anwar
You are given a string, $str, containing lowercase English letters only.
Write a script to print the first letter that appears twice.
@@ -40,12 +40,12 @@ multi task( Str:D $in, Bool:D :$case-ck! ) {
}
multi task( Str:D $in --> Str ) {
my $s = ().SetHash;
- my $e = $s.elems;
+ my $prev = $s.elems;
for 0..$in.chars -> \i {
my $c = $in.substr( i, 1);
$s.set: $c;
- return $c if $s.elems == $e;
- ++$e ;
+ return $c if $s.elems == $prev;
+ ++$prev;
}
Str;
}
diff --git a/challenge-280/0rir/raku/ch-2.raku b/challenge-280/0rir/raku/ch-2.raku
index c60a29bdcc..39753e1565 100644
--- a/challenge-280/0rir/raku/ch-2.raku
+++ b/challenge-280/0rir/raku/ch-2.raku
@@ -4,8 +4,7 @@ use v6.d;
use Test;
=begin comment
-Task 2: Count Asterisks
-Submitted by: Mohammad Sajid Anwar
+280-2: Count Asterisks Submitted by: Mohammad Sajid Anwar
REPHASED
Given a string, $str, where two consecutive vertical bars group the chars
between them; a bar can only pair with one or none other bar.