diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2019-07-26 19:48:42 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-26 19:48:42 +0100 |
| commit | 5bcc84656e2567c10e644c26558d1685085caa14 (patch) | |
| tree | 8bbf984e3b8a037b9aaa5c0c912b2e82f1c69068 | |
| parent | 0c3b65d4c7cb5b90f1807dbc66917dac4bb31f4b (diff) | |
| parent | 2839bf9be91b466f368eafe4e7bb75503f82ae5a (diff) | |
| download | perlweeklychallenge-club-5bcc84656e2567c10e644c26558d1685085caa14.tar.gz perlweeklychallenge-club-5bcc84656e2567c10e644c26558d1685085caa14.tar.bz2 perlweeklychallenge-club-5bcc84656e2567c10e644c26558d1685085caa14.zip | |
Merge pull request #421 from kolcon/lk_chal_018
Remove unnecessary variable
| -rw-r--r-- | challenge-018/lubos-kolouch/perl5/ch-1.pl | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/challenge-018/lubos-kolouch/perl5/ch-1.pl b/challenge-018/lubos-kolouch/perl5/ch-1.pl index fef4d9155e..7ba1dc53d2 100644 --- a/challenge-018/lubos-kolouch/perl5/ch-1.pl +++ b/challenge-018/lubos-kolouch/perl5/ch-1.pl @@ -27,7 +27,6 @@ use feature qw{ say }; use Data::Dumper; my %all_strings; -my $max_count = 0; # ignore substrings my $seen_first; @@ -55,10 +54,7 @@ sub insert_to_all_strings { my $current_count = $all_strings{$sub_string} // 0; $current_count++; - # We have seen the substring one more time - $max_count = $current_count if $current_count > $max_count; - - # Let us remember it + # Let us store the count $all_strings{ length($sub_string) }{$sub_string}++; } |
