From 2839bf9be91b466f368eafe4e7bb75503f82ae5a Mon Sep 17 00:00:00 2001 From: Lubos Kolouch Date: Fri, 26 Jul 2019 19:15:31 +0200 Subject: Remove unnecessary variable --- challenge-018/lubos-kolouch/perl5/ch-1.pl | 6 +----- 1 file changed, 1 insertion(+), 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}++; } -- cgit