Unique numbers-2

time limit exceeding in the answer?

I have edited your code, try to submit now…