This question already has an answer here:
- Maximize :: $A = B \times C$ 3 answers
I found the following puzzle:
Use all the digits from 1 to 9 without repeating, to form two numbers such that their product is maximum. A digit used should be unique across both the numbers. For example, the numbers formed could be 1234 and 56789.
I know that the answer is 9642 and 87531.
It is obvious that digits should form the numbers in descending order.
I've spent so much time trying to prove that:
for the maximum product numbers should be 4-digit and 5-digit
why people use greedy algorithm for solving the puzzle so that they start from the first digit and add one by one other digits?