Originally posted by Ankur Sharma:
Could any one tell me what is the logic to calculate this problem. Atleast direct others how to calculate this problem or tell the algorithm to solve it....
You could look at it as an integer linear programming problem.
Find A,B,C,D,E such that.
A*10000 + B*1000 + C*100 + D*10 + E = 4*(E*10000 + D*1000 + C*100 + B*10 + A)
- or -
A*9996 + B*960 - C*300 - D*3990 - E*39999 = 0
A >= 0
A <= 9
B >= 0
B <= 9
C >= 0
C <= 9
D >= 0
D <= 9
E >= 0
E <= 9