> Does not say "I want to sometimes replace the first and sometimes replace the second duplicate value."
Has said that consistently right through.
In the very first post in this thread.
Example:
input vector has values {1,12,8,1,7,15,20,9,12}
output vector after function {17,12,8,1,7,15,20,9,2}
where the boldfaced number have been randomly modified. |
> simply reversing the order the array was traversed every other call would
> still keep the execution time considerably faster than yours.
Yes it will 'keep the execution time considerably faster than yours'
As would this:
inline void ems_uniqueify(std::vector<int>& v) {}
Neither would meet the requirements.
'Every other call' is naive; there is nothing random about it. Even if that was randomly decided, if a value appears thrice, the first or the last would be replaced with a probability of 50%, the middle one would be replaced with a probability of 100%.
I'm not going to pursue this increasingly meaningless discussion any more. I've have been satiated.