in reply to Re^7: Divide array of integers into most similar value halves
in thread Divide array of integers into most similar value halves
@union = @intersection = @difference = (); %count = (); foreach $element (@array1, @array2) { $count{$element}++ } foreach $element (keys %count) { push @union, $element; push @{ $count{$element} > 1 ? \@intersection : \@difference } +, $element; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: Divide array of integers into most similar value halves
by BrowserUk (Patriarch) on Sep 04, 2008 at 16:11 UTC | |
by Pepe (Sexton) on Sep 04, 2008 at 17:35 UTC | |
by BrowserUk (Patriarch) on Sep 04, 2008 at 18:29 UTC | |
by BrowserUk (Patriarch) on Sep 04, 2008 at 20:27 UTC | |
by Pepe (Sexton) on Sep 04, 2008 at 21:02 UTC | |
by BrowserUk (Patriarch) on Sep 04, 2008 at 21:26 UTC | |
by BrowserUk (Patriarch) on Sep 04, 2008 at 21:33 UTC | |
|