Confusion in "Mike and HashTrick" question

I am unable to understand, what actually I have to do. The logic explained in Hint video is giving me wrong answer. It will be very helpful if you can give another example with better explanation.

@vinay86048,

We know everytime a number repeats, it is given a new hash value, which is equal to the number of distinct numbers occurred till now. So we can just store the last occurrences of all the numbers and assign the values incrementally, in increasing order of the positions of their last occurrences.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.