Pascal666 has asked for the wisdom of the Perl Monks concerning the following question:
Given a string containing 9 hexadecimal characters, I need to generate a list of all possible 10 character hexadecimal strings that contain the given 9 characters in order. The list need not be in any specific order.
I think the complete list will have 16x10=160 items, but 9 of those will be duplicates. Don't worry about removing the duplicates, but if your solution doesn't include them that is fine too.
Obviously, this can be done with a couple nested loops and string concatenation. Somehow, that just doesn't feel like the best way to me though.
For example, given 0ae4bb830, the list would include:
*Duplicate00ae4bb830 10ae4bb830 20ae4bb830 30ae4bb830 40ae4bb830 50ae4bb830 60ae4bb830 70ae4bb830 80ae4bb830 90ae4bb830 a0ae4bb830 b0ae4bb830 c0ae4bb830 d0ae4bb830 e0ae4bb830 f0ae4bb830 00ae4bb830* 01ae4bb830 02ae4bb830 03ae4bb830 04ae4bb830 ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Generate list of possibilities from incomplete input
by tybalt89 (Monsignor) on Jan 21, 2018 at 01:30 UTC | |
|
Re: Generate list of possibilities from incomplete input
by johngg (Canon) on Jan 21, 2018 at 01:03 UTC | |
|
Re: Generate list of possibilities from incomplete input
by BillKSmith (Monsignor) on Jan 21, 2018 at 04:09 UTC |