3
How could I delete repeated values in a table? Ex:
a = {1,2,3,4,3,2,1}
How would you delete 3, 2 and 1, keeping only one of each?
My table is one inside another:
a = {
{a=1, b=2},
{a=2, b=3},
{a=1, b=2},
}
In that case, the last value would be deleted, since the a
and the b
of it and of the first are equal. Pairs should be considered as a value only for comparison purposes. How to do this?
It would have as a functional example in the IDEONE? I couldn’t get your code running as it is.
– Bacco