I have to make an app that generated a random phone number.
There can`t be any 8 or 9 digits in the first set.
There can`t be a number higher than 742 in the second. It says that it is possible to construct the number without determining each digit separately. I couldn`t figure out how to (if possible) define the first set without defining every dig separately, and wrote it this way:
I don't know of any method to generate a random number that doesn't have a specific digit in it. The fact that you've optimised number generation for the second and third parts of the number means that you aren't generating random numbers for each individual digit.