What wrong in this code
@Adityakumar3112, i think you have misunderstood the questipn , as you have to print k (k is the number of distinct number) and ith line is the array value with hash value as i-1 you are doing opposite of that,
Now the problem that you may encounter is of collision where you have multiple distinct array values with same hash value. In that case you have to print on the basis of highest index .
you can watch this vedio for reference:-
In case you have any trouble in forming logic , then do ask me 
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.