Iterate through array and see how many there are of each element
If there's more than one of the element, delete the entries from the array
reassign element so that it doesn't get deleted which would mess up the each iteration