a = {{a=1, b=2}, {a=2, b=3}, {a=1, b=2}, {a=3, b=2}, {a=1, b=2}}
for i = #a, 2, -1 do
for j = i - 1, 1, -1 do
if (a[j].a == a[i].a and a[j].b == a[i].b) then
table.remove(a, i)
break
end
end
end
-- demonstraĆ§Ć£o do resultado:
for i, j in pairs(a) do
print(i .. ". a=" .. j.a .. ", b=" .. j.b)
end
--https://pt.stackoverflow.com/q/38705/101
YSA9IHt7YT0xLCBiPTJ9LCB7YT0yLCBiPTN9LCB7YT0xLCBiPTJ9LCB7YT0zLCBiPTJ9LCB7YT0xLCBiPTJ9fQogCmZvciBpID0gI2EsIDIsIC0xIGRvCglmb3IgaiA9IGkgLSAxLCAxLCAtMSBkbwoJCWlmIChhW2pdLmEgPT0gYVtpXS5hIGFuZCBhW2pdLmIgPT0gYVtpXS5iKSB0aGVuCgkJCXRhYmxlLnJlbW92ZShhLCBpKQoJCQlicmVhawoJCWVuZAoJZW5kCmVuZAogCi0tIGRlbW9uc3RyYcOnw6NvIGRvIHJlc3VsdGFkbzoKZm9yIGksIGogaW4gcGFpcnMoYSkgZG8KCXByaW50KGkgLi4gIi4gYT0iIC4uIGouYSAuLiAiLCBiPSIgLi4gai5iKQplbmQKCi0taHR0cHM6Ly9wdC5zdGFja292ZXJmbG93LmNvbS9xLzM4NzA1LzEwMQ==