Lua table removing duplicates
snippet in lua

Lua table removing duplicates

user2133

local Dupes ={}  
local t2 = {};  
for i,v in pairs(t1) do
    if(t2[v] ~= nil) then
        table.insert(Dupes,v)
    end
    t2[v] = i
end