To ensure that you get as close to the target number as possible, you should only worry about the first digit of both numbers you are multiplying. For example, when trying to get to 100 with a two digit number and a one digit number, we should only worry about the one digit number and the tens place of the two digit number. Out of the three numbers that you pick, which two get you the closest to 100 / 10^1? (Target number divided by 10 to the power of the total number of digits in the numbers you're multiplying, minus 2 or T / 10^D - 2) Say, you got the numbers 5, 2 and 8. When you get a 5 and 2, those two will always be the first digits of both numbers you multiply, and this is because 5 2 = 10, which is the target value of 'T / 10^D - 2'.
For this case, put the lower number in the front of the smaller-digit number. In this case, the one digit number. This is because you multiply the one digit number by the ones place in the two digit number and you want that extra value to be as little as possible. So the multiplication problem would be 58 * 2. This will be how you arrange your numbers when the product of the two digits you plan to put on the front of the numbers you are multiplying is more than or equal to 10 (T / 10^D - 2 for other cases)
So, 5 and 2 would be the best solution, since it multiplies exactly to your target number. The next best solutions are here:
3 and 3 (9)
9 and 1 (9)
2 and 4 (8)
8 and 1 (8)
3 and 4 (12)
You're essentially trying to find two numbers that will get you closest to the number 10. In the case where the product of the two digits you plan to put on the front of the numbers you are multiplying is less than 10, you want to try to get more value in your answer. This means essentially, you're going to do the opposite of what should be done if the product of both digits is more than or equal to 10. The further your number is from the answer, the more value you will want to earn.
This will not always work, so you should try rearranging the last few digits to get as close as possible. Move from left to right, the closer to the left the digits are, the higher value they have, so moving them will have a large effect. Mostly, this problem is a matter of trial and error, check your answer and see if you can get closer. It is more likely to work when the numbers are further away from the target numbers.