aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-193/vamsi-meenavilli/perl/ch-1.pl7
-rw-r--r--challenge-193/vamsi-meenavilli/python/ch-1.py2
2 files changed, 2 insertions, 7 deletions
diff --git a/challenge-193/vamsi-meenavilli/perl/ch-1.pl b/challenge-193/vamsi-meenavilli/perl/ch-1.pl
index ccd179a814..03047a7c83 100644
--- a/challenge-193/vamsi-meenavilli/perl/ch-1.pl
+++ b/challenge-193/vamsi-meenavilli/perl/ch-1.pl
@@ -26,12 +26,7 @@ is(binaryString(3), ['000', '001', '010', '011', '100', '101', '110', '111'], 'E
sub binaryString {
my ($binary_number_size) = @_;
- my @binary_strings = ();
- for (my $i = 0; $i < 2**$binary_number_size; $i++) {
- push(@binary_strings, sprintf("%0${binary_number_size}b", $i))
- }
-
- return(\@binary_strings);
+ return [map {sprintf("%0${binary_number_size}b", $_)} (0..(2**$binary_number_size) - 1)];
}
done_testing(); \ No newline at end of file
diff --git a/challenge-193/vamsi-meenavilli/python/ch-1.py b/challenge-193/vamsi-meenavilli/python/ch-1.py
index 00a3fd9ed6..562b55f4fb 100644
--- a/challenge-193/vamsi-meenavilli/python/ch-1.py
+++ b/challenge-193/vamsi-meenavilli/python/ch-1.py
@@ -1,7 +1,7 @@
"""
Week 192:
- https://theweeklychallenge.org/blog/perl-weekly-challenge-193
+ https://theweeklychallenge.org/blog/perl-weekly-challenge-193
Task 1: Binary String
Submitted by: Mohammad S Anwar