Kth root problem

what’s wrong in this code? 1 test case getting failed, also is it the right approach to this problem?

@rockstarpkm,
The problem is precision issue. At large k, n^(1/k) would be so small, that it would not be accurately calculated by pow() function.
So this isn’t the correct way to approach this problem, with such large constraints. Try thinking of something else.

1 Like

tried binary search. Still getting one wrong test case in this code. its showing garbage value on large inputs.

@rockstarpkm,
You are making many cases, maybe there is a error in there somewhere, here try this, better implementation,