Given a number n, such as 23121; Given A set of Numbers as A,4,9 {2}, and composed of elements in A less than the maximum number of n, such as less than the maximum number of 23121 to 22999 DFS (was going to use to do but stuck to seek you dalao solution)
CodePudding user response:
It is relatively simple? 1. The first n you points out, 2. Given a set of digital smallest 3. The n digits compared to a set of Numbers (key), set a flag lessThan=0; If you can find the same, with equal, If it is the last one, find the equal with equal after a If you cannot find quite etc, there is little, lessThan=1; All the rest of the biggest inside with a given number of,