Find unique random numbers - I'm stuck , Please Help! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Find unique random numbers - I'm stuck , Please Help!

Hello fellow coders, I want to generate n random unique numbers from 1-10. With my code, I can generate random numbers from 1-10, but they're not unique and gets repeated. Could you help me with the logic, Thanks! https://code.sololearn.com/Wqy0boM0iMgK

16th Sep 2019, 8:41 PM
Jojo
Jojo - avatar
2 Answers
16th Sep 2019, 8:46 PM
Dejan Dozet
Dejan Dozet - avatar
0
so its like if the number is duplicate then search for other random ?
16th Sep 2019, 8:46 PM
Taste
Taste - avatar