I have numbers from 1 to 2500, and I need to number all the possible non-repeated strings of them with length 8. For example:
1,2,3,4,5,6,7,8---index 1
1,2,3,4,5,6,7,9---index 2
I want to develop a code which ask for the index and gives me the related string. For example:
Mycode(1)----> 1,2,3,4,5,6,7,8
Up to now the problem is pretty easy, and I can do it in a couple of lines. The thing which makes the problem very difficult for me is that we have constraints. Each number has problem with some of the numbers. For example, 1 never comes with 2 or 65 or 66. Therefore, I have to remove all the infeasible strings when numbering them.
I developed a recursive code for it, but it took a lot of time for finding each string, and time consumption is pretty important for me.
Thanks in advance and looking forward to hearing back from you.