diff options
| author | Paulo Custodio <pauloscustodio@gmail.com> | 2021-10-26 09:52:33 +0100 |
|---|---|---|
| committer | Paulo Custodio <pauloscustodio@gmail.com> | 2021-10-26 09:52:33 +0100 |
| commit | 4fbb301ccb5620c8bcee20462bd1bb8145b0d13c (patch) | |
| tree | ca2cd6d56d2437c433c0913480dd769a0566911b /challenge-134 | |
| parent | de4d4e92a64a4cd61ae6db8da41662c88553772a (diff) | |
| download | perlweeklychallenge-club-4fbb301ccb5620c8bcee20462bd1bb8145b0d13c.tar.gz perlweeklychallenge-club-4fbb301ccb5620c8bcee20462bd1bb8145b0d13c.tar.bz2 perlweeklychallenge-club-4fbb301ccb5620c8bcee20462bd1bb8145b0d13c.zip | |
Whitespace
Diffstat (limited to 'challenge-134')
| -rw-r--r-- | challenge-134/paulo-custodio/perl/ch-1.pl | 8 | ||||
| -rw-r--r-- | challenge-134/paulo-custodio/perl/ch-2.pl | 14 | ||||
| -rw-r--r-- | challenge-134/paulo-custodio/python/ch-1.py | 8 | ||||
| -rw-r--r-- | challenge-134/paulo-custodio/python/ch-2.py | 4 | ||||
| -rw-r--r-- | challenge-134/paulo-custodio/t/test-1.yaml | 2 |
5 files changed, 18 insertions, 18 deletions
diff --git a/challenge-134/paulo-custodio/perl/ch-1.pl b/challenge-134/paulo-custodio/perl/ch-1.pl index d7ccd780e7..637e723c76 100644 --- a/challenge-134/paulo-custodio/perl/ch-1.pl +++ b/challenge-134/paulo-custodio/perl/ch-1.pl @@ -3,10 +3,10 @@ # TASK #1 > Pandigital Numbers # Submitted by: Mohammad S Anwar # Write a script to generate first 5 Pandigital Numbers in base 10. -# +# # As per the wikipedia, it says: -# -# A pandigital number is an integer that in a given base has among its +# +# A pandigital number is an integer that in a given base has among its # significant digits each digit used in the base at least once. # solution from https://oeis.org/A050278 @@ -16,4 +16,4 @@ use Math::Combinatorics; my @A050278 = sort {$a<=>$b} map {0+join('', @$_)} grep {$_->[0]!=0} permute(0..9); splice(@A050278, 5, $#A050278); -say join("\n", @A050278);
\ No newline at end of file +say join("\n", @A050278); diff --git a/challenge-134/paulo-custodio/perl/ch-2.pl b/challenge-134/paulo-custodio/perl/ch-2.pl index 8a01b8ee55..617193f257 100644 --- a/challenge-134/paulo-custodio/perl/ch-2.pl +++ b/challenge-134/paulo-custodio/perl/ch-2.pl @@ -3,8 +3,8 @@ # TASK #2 > Distinct Terms Count # Submitted by: Mohammad S Anwar # You are given 2 positive numbers, $m and $n. -# -# Write a script to generate multiplication table and display count of distinct +# +# Write a script to generate multiplication table and display count of distinct # terms. use Modern::Perl; @@ -12,9 +12,9 @@ use Modern::Perl; my($m, $n) = @ARGV or die "Usage: ch-2.pl m n\n"; my %terms; for my $a (1..$m) { - for my $b (1..$n) { - my $prod = $a*$b; - $terms{$prod} = 1; - } + for my $b (1..$n) { + my $prod = $a*$b; + $terms{$prod} = 1; + } } -say scalar(keys %terms);
\ No newline at end of file +say scalar(keys %terms); diff --git a/challenge-134/paulo-custodio/python/ch-1.py b/challenge-134/paulo-custodio/python/ch-1.py index 814125549b..55590a928a 100644 --- a/challenge-134/paulo-custodio/python/ch-1.py +++ b/challenge-134/paulo-custodio/python/ch-1.py @@ -3,17 +3,17 @@ # TASK #1 > Pandigital Numbers # Submitted by: Mohammad S Anwar # Write a script to generate first 5 Pandigital Numbers in base 10. -# +# # As per the wikipedia, it says: -# -# A pandigital number is an integer that in a given base has among its +# +# A pandigital number is an integer that in a given base has among its # significant digits each digit used in the base at least once. # solution from https://oeis.org/A050278 from itertools import permutations -A050278 = [int(''.join(d)) for d in permutations('0123456789', 10) if d[0] != '0'] +A050278 = [int(''.join(d)) for d in permutations('0123456789', 10) if d[0] != '0'] A050278.sort() for i in range(0, 5): print(A050278[i]) diff --git a/challenge-134/paulo-custodio/python/ch-2.py b/challenge-134/paulo-custodio/python/ch-2.py index d378a11ca2..b37227a192 100644 --- a/challenge-134/paulo-custodio/python/ch-2.py +++ b/challenge-134/paulo-custodio/python/ch-2.py @@ -3,8 +3,8 @@ # TASK #2 > Distinct Terms Count # Submitted by: Mohammad S Anwar # You are given 2 positive numbers, $m and $n. -# -# Write a script to generate multiplication table and display count of distinct +# +# Write a script to generate multiplication table and display count of distinct # terms. import sys diff --git a/challenge-134/paulo-custodio/t/test-1.yaml b/challenge-134/paulo-custodio/t/test-1.yaml index 81b36fedcb..505eb2be78 100644 --- a/challenge-134/paulo-custodio/t/test-1.yaml +++ b/challenge-134/paulo-custodio/t/test-1.yaml @@ -1,6 +1,6 @@ - setup: cleanup: - args: + args: input: output: | 1023456789 |
