my @result = do { my %counter; grep ++$counter{$_} == 2, @input; };
-- Randal L. Schwartz, Perl hacker
In reply to •Re: Get All Duplicated Elements in an Array (Once, without shifting)
by merlyn
in thread Get All Duplicated Elements in an Array (Once, without shifting)
by George_Sherston
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |