The point of this challenge is to find the smallest positive integer that uses up at least all of the digits supplied in the input after it is squared and cubed.
So, when provided an input such as 0123456789
(i.e. a number that finds the result):
69² = 4761
69³ = 328509
It means that 69
is the result of such an input. (Fun fact: 69 is the smallest number that uses up all of the decimal digits of 0 to 9 after squaring and cubing.)
Specification
The input doesn't have to be unique. For example, the input can be 1466
and here's the result:
4² = 16
4³ = 64
That means we can't just fulfill this input by just doing a number that only uses 1 digit of 6
, it has to have 2 digits of 6 in the output.
Test cases
Here's an exhaustive list of all numbers from 1 to 10000.
1333 (or 3133/3313/3331) -> 111
Input specification
- You may take input as a list of digits.
- Since the test cases (somehow) have a bug in it, here's an extra rule: the
0
's in the input will be ignored.
50
your list says the output should be5
which gives us the digits25 125
which contains no zeros. Does this mean we can ignore zeros in the input? because your example with 69 as an output did not imply that. \$\endgroup\$