I have recently participated in a coding contest where one of the problems was as follows:
Given two integers X and Y, find the minimum number of steps required to convert X to Y. You can perform the following operations any number of times in any order:
1) Divide X by any integer A, 2)Multiply X by any integer B.
Example: If X=15 and Y=10, then first multiply X by 2 which gives 30 and then divide 30 by 3 to get Y(i.e.,10). So the minimum no. of steps in this case is 2.
I have no idea how to solve it.