diff options
| author | David Ferrone <zapwai@gmail.com> | 2024-04-22 10:52:24 -0400 |
|---|---|---|
| committer | David Ferrone <zapwai@gmail.com> | 2024-04-22 10:52:24 -0400 |
| commit | 042b3ce8105163b5067fe998724497efa1544100 (patch) | |
| tree | 390875e1b27380ff9f24a4959d7bb188cf7323ca | |
| parent | c6d98285b8aa8be2852b9de1cbc1c9f57ded3d3b (diff) | |
| download | perlweeklychallenge-club-042b3ce8105163b5067fe998724497efa1544100.tar.gz perlweeklychallenge-club-042b3ce8105163b5067fe998724497efa1544100.tar.bz2 perlweeklychallenge-club-042b3ce8105163b5067fe998724497efa1544100.zip | |
Ancient Update
| -rw-r--r-- | challenge-018/zapwai/c/ch-1.c | 46 | ||||
| -rw-r--r-- | challenge-018/zapwai/javascript/ch-1.js | 46 | ||||
| -rw-r--r-- | challenge-018/zapwai/perl/ch-1.pl | 46 | ||||
| -rw-r--r-- | challenge-018/zapwai/python/ch-1.py | 46 | ||||
| -rw-r--r-- | challenge-018/zapwai/rust/ch-1.rs | 46 |
5 files changed, 0 insertions, 230 deletions
diff --git a/challenge-018/zapwai/c/ch-1.c b/challenge-018/zapwai/c/ch-1.c deleted file mode 100644 index d9aa2d1a54..0000000000 --- a/challenge-018/zapwai/c/ch-1.c +++ /dev/null @@ -1,46 +0,0 @@ -use v5.38; -if (@ARGV < 2) { - say "Please provide two (or more) arguments."; - exit; -} - -sub gen_substr($word) { - my @subs; - my $current_length = 1; - my $a = -1; - do { - $a++; - if ($a + $current_length > length $word) { - $a = 0; - $current_length++; - } - push @subs, substr($word, $a, $current_length); - } while ($current_length < length $word); - return @subs; -} - -sub common(@list) { - my $ans; - my @subs; - for my $i (0 .. $#list) { - push @subs, gen_substr($list[$i]); - } - my @common; - for my $i (0 .. $#subs) { - for my $j (0 .. $#subs) { - next if ($i == $j); - push @common, $subs[$i] if ($subs[$i] eq $subs[$j]); - } - } - my $max = 0; - my $ans_word; - for my $word (@common) { - if (length $word > $max) { - $max = length $word; - $ans_word = $word; - } - } - return $ans_word; -} - -say common(@ARGV); diff --git a/challenge-018/zapwai/javascript/ch-1.js b/challenge-018/zapwai/javascript/ch-1.js deleted file mode 100644 index d9aa2d1a54..0000000000 --- a/challenge-018/zapwai/javascript/ch-1.js +++ /dev/null @@ -1,46 +0,0 @@ -use v5.38; -if (@ARGV < 2) { - say "Please provide two (or more) arguments."; - exit; -} - -sub gen_substr($word) { - my @subs; - my $current_length = 1; - my $a = -1; - do { - $a++; - if ($a + $current_length > length $word) { - $a = 0; - $current_length++; - } - push @subs, substr($word, $a, $current_length); - } while ($current_length < length $word); - return @subs; -} - -sub common(@list) { - my $ans; - my @subs; - for my $i (0 .. $#list) { - push @subs, gen_substr($list[$i]); - } - my @common; - for my $i (0 .. $#subs) { - for my $j (0 .. $#subs) { - next if ($i == $j); - push @common, $subs[$i] if ($subs[$i] eq $subs[$j]); - } - } - my $max = 0; - my $ans_word; - for my $word (@common) { - if (length $word > $max) { - $max = length $word; - $ans_word = $word; - } - } - return $ans_word; -} - -say common(@ARGV); diff --git a/challenge-018/zapwai/perl/ch-1.pl b/challenge-018/zapwai/perl/ch-1.pl deleted file mode 100644 index d9aa2d1a54..0000000000 --- a/challenge-018/zapwai/perl/ch-1.pl +++ /dev/null @@ -1,46 +0,0 @@ -use v5.38; -if (@ARGV < 2) { - say "Please provide two (or more) arguments."; - exit; -} - -sub gen_substr($word) { - my @subs; - my $current_length = 1; - my $a = -1; - do { - $a++; - if ($a + $current_length > length $word) { - $a = 0; - $current_length++; - } - push @subs, substr($word, $a, $current_length); - } while ($current_length < length $word); - return @subs; -} - -sub common(@list) { - my $ans; - my @subs; - for my $i (0 .. $#list) { - push @subs, gen_substr($list[$i]); - } - my @common; - for my $i (0 .. $#subs) { - for my $j (0 .. $#subs) { - next if ($i == $j); - push @common, $subs[$i] if ($subs[$i] eq $subs[$j]); - } - } - my $max = 0; - my $ans_word; - for my $word (@common) { - if (length $word > $max) { - $max = length $word; - $ans_word = $word; - } - } - return $ans_word; -} - -say common(@ARGV); diff --git a/challenge-018/zapwai/python/ch-1.py b/challenge-018/zapwai/python/ch-1.py deleted file mode 100644 index d9aa2d1a54..0000000000 --- a/challenge-018/zapwai/python/ch-1.py +++ /dev/null @@ -1,46 +0,0 @@ -use v5.38; -if (@ARGV < 2) { - say "Please provide two (or more) arguments."; - exit; -} - -sub gen_substr($word) { - my @subs; - my $current_length = 1; - my $a = -1; - do { - $a++; - if ($a + $current_length > length $word) { - $a = 0; - $current_length++; - } - push @subs, substr($word, $a, $current_length); - } while ($current_length < length $word); - return @subs; -} - -sub common(@list) { - my $ans; - my @subs; - for my $i (0 .. $#list) { - push @subs, gen_substr($list[$i]); - } - my @common; - for my $i (0 .. $#subs) { - for my $j (0 .. $#subs) { - next if ($i == $j); - push @common, $subs[$i] if ($subs[$i] eq $subs[$j]); - } - } - my $max = 0; - my $ans_word; - for my $word (@common) { - if (length $word > $max) { - $max = length $word; - $ans_word = $word; - } - } - return $ans_word; -} - -say common(@ARGV); diff --git a/challenge-018/zapwai/rust/ch-1.rs b/challenge-018/zapwai/rust/ch-1.rs deleted file mode 100644 index d9aa2d1a54..0000000000 --- a/challenge-018/zapwai/rust/ch-1.rs +++ /dev/null @@ -1,46 +0,0 @@ -use v5.38; -if (@ARGV < 2) { - say "Please provide two (or more) arguments."; - exit; -} - -sub gen_substr($word) { - my @subs; - my $current_length = 1; - my $a = -1; - do { - $a++; - if ($a + $current_length > length $word) { - $a = 0; - $current_length++; - } - push @subs, substr($word, $a, $current_length); - } while ($current_length < length $word); - return @subs; -} - -sub common(@list) { - my $ans; - my @subs; - for my $i (0 .. $#list) { - push @subs, gen_substr($list[$i]); - } - my @common; - for my $i (0 .. $#subs) { - for my $j (0 .. $#subs) { - next if ($i == $j); - push @common, $subs[$i] if ($subs[$i] eq $subs[$j]); - } - } - my $max = 0; - my $ans_word; - for my $word (@common) { - if (length $word > $max) { - $max = length $word; - $ans_word = $word; - } - } - return $ans_word; -} - -say common(@ARGV); |
