Does anyone have an algorithm that generates all 10-digit integers that have at least one digit repeated? Trawling through all 9000000000 of them and checking them individually is too slow. Thanks.

## Recommended Answers

Jump to PostDoes anyone have an algorithm that generates all 10-digit integers that have at least one digit repeated? Trawling through all 9000000000 of them and checking them individually is too slow. Thanks.

10 digit number, 10 digits, none repeated, sounds like you can generate all permutations of 0123456789, then throw out …

Jump to Post10! is 3,628,800. 10 to the 10th power is 10 billion. Take away the numbers that start with 0 and that's what you're working with. You have, again, two options. One way or another, you have a loop of 9 billion if you need to "pop out" a number each …

## All 8 Replies

VernonDozier
2,218
Posting Expert
Featured Poster

stinkypete

VernonDozier
2,218
Posting Expert
Featured Poster

jaskij
45
Junior Poster in Training

Zvjezdan23
-13
Junior Poster

stinkypete

stinkypete

VernonDozier
2,218
Posting Expert
Featured Poster

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.