in reply to Clarification of code - find array intersection
relientmark, It would help if you read How do I post a question effectively?@union = @intersection = @difference = (); %count = (); foreach $element (@array1, @array2) { $count{$element}++ } foreach $element (keys %count) { push @union, $element; push @{ $count{$element} > 1 ? \@intersection : \@difference }, $e +lement; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Clarification of code - find array intersection
by relientmark (Novice) on Mar 16, 2011 at 03:18 UTC | |
by Anonymous Monk on Mar 16, 2011 at 17:24 UTC |