in reply to Re^2: Subtracting Lists
in thread Subtracting Lists
Even without that requirement, if the original array contained duplicate values, a solution that collapsed the original into a hash would eliminate duplicates, and , IMHO, provide a wrong result.
However, 3 good solutions which do not collapse the original array have been provided by others, below.
I would suggest that educated_foo's (++) is the most portable,readable one with no dependencies.
"A fanatic is one who redoubles his effort when he has forgotten his aim."—George Santayana
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Subtracting Lists
by ikegami (Patriarch) on Jun 02, 2008 at 06:12 UTC | |
by educated_foo (Vicar) on Jun 02, 2008 at 16:38 UTC | |
|
Re^4: Subtracting Lists
by ikegami (Patriarch) on Jun 02, 2008 at 06:03 UTC | |
by NetWallah (Canon) on Jun 02, 2008 at 06:09 UTC | |
by blazar (Canon) on Jun 02, 2008 at 17:03 UTC |