in reply to Re: Re: Eliminate duplicate and original values
in thread Eliminate duplicate and original values

I came up with this, at 46 chars:
@array=do{grep$_{$_}<2,grep{!$_{$_}++}@array};
Of course, if we were truely golfing, that comes out at:
sub find_duplicates { #23456789_123456789_123456789_ grep$_{$_}<2,grep{!$_{$_}++}@_ }
30 characters :)

Replies are listed 'Best First'.
Re: Re: Re: Re: Eliminate duplicate and original values
by DrManhattan (Chaplain) on Nov 26, 2001 at 04:02 UTC
    Eliminating the hashes chops it down to 24, but of course it won't run with strict refs in use.
    #23456789_123456789_1234 grep$$_<2,grep{!$$_++}@_

    -Matt