Given a value x find the smallest numerical value greater than y that is capable of being multiplied and divided by x while retaining all original digits.
- The new numbers do not lose digits.
- The new numbers do not gain digits.
Input: x = 2, y = 250000
- Original: 285714
- Division: 142857
- Multiplication: 571428
This is true because 285714 is greater than y; then when divided by x results in 142857 and when multiplied by x results in 571428. In both tests all of the original digits from 285714 are present and no extra digits have been added.
- X should be 2 or 3 as anything higher takes too long to calculate.
- Y is required to be a whole number greater than zero.
- The shortest code wins.
These are my most common test cases as they are the quickest to test for.
- x = 2, y = 250000 = 285714
- x = 2, y = 290000 = 2589714
- x = 2, y = 3000000 = 20978514
- x = 3, y = 31000000 = 31046895
- x = 3, y = 290000000 = 301046895
- The type of division doesn't matter. If you can get 2.05, 0.25, and 5.20 somehow then feel free.
Good luck to you all!