You are viewing a single comment's thread. Return to all comments →
sub equalizeArray { my $array = shift; my %freq; $freq{$_}++ for @$array; my @freq = sort { $freq{$b} <=> $freq{$a} } keys %freq; return @$array - $freq{$freq[0]}; }
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Equalize the Array
You are viewing a single comment's thread. Return to all comments →