aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-239/lacek96/README1
-rw-r--r--challenge-239/lacek96/perl/ch-1.pl43
2 files changed, 44 insertions, 0 deletions
diff --git a/challenge-239/lacek96/README b/challenge-239/lacek96/README
new file mode 100644
index 0000000000..01892f5cee
--- /dev/null
+++ b/challenge-239/lacek96/README
@@ -0,0 +1 @@
+Solution by lacek96
diff --git a/challenge-239/lacek96/perl/ch-1.pl b/challenge-239/lacek96/perl/ch-1.pl
new file mode 100644
index 0000000000..c8f2f642eb
--- /dev/null
+++ b/challenge-239/lacek96/perl/ch-1.pl
@@ -0,0 +1,43 @@
+#!/usr/bin/perl -w
+use v5.32;
+use strict;
+use warnings;
+
+sub areSameStrings
+{
+ my ($ArrRef1, $ArrRef2) = @_;
+
+ my @array1 = @{$ArrRef1};
+ my @array2 = @{$ArrRef2};
+
+ my $text1 = join('',@array1);
+ my $text2 = join('',@array2);
+
+ if ($text1 eq $text2)
+ {
+ say "true";
+ }
+ else
+ {
+ say "false";
+ }
+}
+
+sub main
+{
+ my @arr1 = ("ab", "c");
+ my @arr2 = ("a", "bc");
+
+ my @arr3 = ("ab", "c");
+ my @arr4 = ("ac", "b");
+
+ my @arr5 = ("ab", "cd", "e");
+ my @arr6 = ("abcde");
+
+ areSameStrings(\@arr1,\@arr2);
+ areSameStrings(\@arr3,\@arr4);
+ areSameStrings(\@arr5,\@arr6);
+
+}
+
+main(); \ No newline at end of file