Let's solve this user's homework; I think it's an interesting exercise!
Two 3-digit natural numbers.
Two 2-digit numbers. In each of the output numbers, one digit is taken from one input number, and the other from the other number. The choice is independent. The first output number should be the minimal possible to create using these constraints, and the second one should be the maximal such number (or vice versa).
- Input numbers never have leading zeros; output numbers should also not have leading zeros.
- Input and output can be encoded as numbers, strings, lists of digits, etc.
Examples (in format
123, 912 - 11, 93 888, 906 - 68, 98 100, 100 - 10, 11 222, 222 - 22, 22 123, 222 - 12, 32 798, 132 - 17, 93