I have a problem that i need to solve. For example this is the list
2 - 7 - 11 - 2 - 7 - 2. there are 2 duplicates of 2's. What i need to write a code for is that i need to delete the last copy of 2 which is the last element in this case.
and also how would i go about deleting the SECOND LAST COPY IF THERE ARE 2 OR MORE THAN 3 DUPLICATED COPIES for example
5 7 11 5 7 5 11 7
in this case i would have to delete the middle 7.
Any help is appreciated. I will post what i have so far. My code deletes all duplicates which is not what i want