Return the whole number x such that x ** m == n, or -1 if there is no such whole number.
For example the cube root of 27 is 3, and 2 has no whole square root, so the answer is -1.
Example 1
Input:
nth_root(27, 3)
Output:
3
Example 2
Input:
nth_root(2, 2)
Output:
-1
1 <= n <= 10**181 <= m <= 40x one by one is too slow for the large tests.No results yet
Run your code to check it against the examples, or submit to run every test.