I have an array with the following elements:
A
B
B
C
B
If an item appears more than once, I have to delete all its occurrences. Therefore, it would be like this:
A
C
I have found lots of examples on how to remove the other repeated elements but still leave the "original" one, out of that I couldn't find anything closer to it and I am really lost.
I have thought about saving in a object the following: 1. The item's value; 2. How many times it appears; 3. The position of all the appearances.
If the times appeared was more than 1, I would remove all of the following positions in the array. Is it a good idea? What would be the best way to do it?
Thank you very much!