diff options
| author | E. Choroba <choroba@matfyz.cz> | 2020-03-05 23:29:09 +0100 |
|---|---|---|
| committer | E. Choroba <choroba@matfyz.cz> | 2020-03-05 23:29:09 +0100 |
| commit | 948a18b410d6a4d02960bd4276d270ddfd4fea1a (patch) | |
| tree | 4dbe7f36e924eb54b2a2d635c09c1a78e5236994 | |
| parent | 5516a4ae45a401e00b331345272c21805b6c5328 (diff) | |
| download | perlweeklychallenge-club-948a18b410d6a4d02960bd4276d270ddfd4fea1a.tar.gz perlweeklychallenge-club-948a18b410d6a4d02960bd4276d270ddfd4fea1a.tar.bz2 perlweeklychallenge-club-948a18b410d6a4d02960bd4276d270ddfd4fea1a.zip | |
Add blogpost from E. Choroba(050: Merge Intervals + Noble Integer)
Also, remove the useless condition from the code.
| -rw-r--r-- | challenge-050/e-choroba/blog.txt | 1 | ||||
| -rwxr-xr-x | challenge-050/e-choroba/perl/ch-1.pl | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/challenge-050/e-choroba/blog.txt b/challenge-050/e-choroba/blog.txt new file mode 100644 index 0000000000..05ab3fbdf2 --- /dev/null +++ b/challenge-050/e-choroba/blog.txt @@ -0,0 +1 @@ +http://blogs.perl.org/users/e_choroba/2020/03/perl-weekly-challenge-050-merge-intervals-and-noble-integer.html diff --git a/challenge-050/e-choroba/perl/ch-1.pl b/challenge-050/e-choroba/perl/ch-1.pl index 436d44f96c..baf1934c4e 100755 --- a/challenge-050/e-choroba/perl/ch-1.pl +++ b/challenge-050/e-choroba/perl/ch-1.pl @@ -19,7 +19,7 @@ use strict; sub out { my ($self) = @_; my @r; - for my $k (sort { $a <=> $b } grep 'same' ne $_, keys %$self) { + for my $k (sort { $a <=> $b } keys %$self) { if (($self->{$k} & (LEFT | RIGHT)) == LEFT) { push @r, [$k]; } elsif (($self->{$k} & (LEFT | RIGHT)) == RIGHT) { |
