Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: find maximum occuring element in a array

by ikegami (Patriarch)
on Sep 07, 2011 at 17:58 UTC ( [id://924633]=note: print w/replies, xml ) Need Help??


in reply to find maximum occuring element in a array

use feature qw( say ); use List::Util qw( max ); ++$counts{$_} for @codes; my $max = max values(%counts); say grep $counts{$_} == $max, keys(%counts);

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://924633]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-25 23:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found