It’s a very simple solution. You make a for loop which makes new numbers, and if it’s the first number you make, you add it to a temporary array. Then every time you generate a new number, you check with your array of already existing numbers, and then if it’s not unique, you add 1 to the counter of your for loop.
This will keep going until you have all your unique numbers. Hope that made sense.
6
solved Generate a set of unique numbers java [duplicate]