diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2022-01-07 18:41:34 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-07 18:41:34 +0000 |
| commit | bd72cefd554c328d7659160de0325d7edf5af0bf (patch) | |
| tree | 1a7ee4a0a06df6c25f61e4b4ec23d96fc1e98b83 | |
| parent | 208b75a7c1919f3c2e3c3098fcb532d71cccfe63 (diff) | |
| parent | b43c0f08abde0c3b6155f22bc6067eaae289b90f (diff) | |
| download | perlweeklychallenge-club-bd72cefd554c328d7659160de0325d7edf5af0bf.tar.gz perlweeklychallenge-club-bd72cefd554c328d7659160de0325d7edf5af0bf.tar.bz2 perlweeklychallenge-club-bd72cefd554c328d7659160de0325d7edf5af0bf.zip | |
Merge pull request #5483 from choroba/ech145-2b
Fix formatting of 145/2, add a link to a blog
| -rw-r--r-- | challenge-145/e-choroba/blog.txt | 1 | ||||
| -rwxr-xr-x | challenge-145/e-choroba/perl/ch-2.pl | 14 |
2 files changed, 8 insertions, 7 deletions
diff --git a/challenge-145/e-choroba/blog.txt b/challenge-145/e-choroba/blog.txt new file mode 100644 index 0000000000..ddf1d60a29 --- /dev/null +++ b/challenge-145/e-choroba/blog.txt @@ -0,0 +1 @@ +http://blogs.perl.org/users/e_choroba/2022/01/eertree-palindromic-tree.html diff --git a/challenge-145/e-choroba/perl/ch-2.pl b/challenge-145/e-choroba/perl/ch-2.pl index 2ee4b431d3..6fffbe2f59 100755 --- a/challenge-145/e-choroba/perl/ch-2.pl +++ b/challenge-145/e-choroba/perl/ch-2.pl @@ -6,10 +6,10 @@ use feature qw{ say }; { package Eertree::Node; use Moo; - has length => (is => 'ro', required => 1); - has pos => (is => 'rwp', required => 1); - has link => (is => 'rw'); - has edge => (is => 'lazy', builder => sub { {} }, predicate => 1); + has length => (is => 'ro', required => 1); + has pos => (is => 'rwp', required => 1); + has link => (is => 'rw'); + has edge => (is => 'lazy', builder => sub { {} }, predicate => 1); sub string { my ($self, $eertree) = @_; @@ -21,11 +21,11 @@ use feature qw{ say }; use Moo; has nodes => (is => 'ro', default => sub { [ - 'Eertree::Node'->new(link => 0, length => -1, pos => -1), - 'Eertree::Node'->new(link => 0, length => 0, pos => 0) + 'Eertree::Node'->new(link => 0, length => -1, pos => -1), + 'Eertree::Node'->new(link => 0, length => 0, pos => 0) ]}); has string => (is => 'ro'); - has max => (is => 'rw', default => 0); + has max => (is => 'rw', default => 0); sub node { my ($self, $index) = @_; |
