The simplest way would be to take an empty dictionary, and put all the values of the array in it. That will remove all duplicates. Next clear the array and push all the keys from the array back in.
Thanks for the idea. The problem was I had to find every pair of identical entries in the array and then decide which one will be deleted by a certain criteria. I was away from my project for a while but now I came back and managed to solve this puzzle in a different way, by using the array in conjunction with object variables, thus avoiding a large number of confusing array loops.