Stuck on this code for a while need help

I think my logic is right about finding the root in the range from 1 to given number using binary search but I am not able to spot the flaws in the code. Please let me know where I am wrong.

@sumitpatil3141_67228965abbfaf85 your approach is not totally correct. Use this hint for better understanding…
We will aplly binary search in this problem. For every possible mid obtained by using binary search we will check of it is the best suitable candidate or not for becoming the Kth root and then we reduce the search space of the binary search according to the mid value. If mid^k is greater than N then we will find the best suitable value from left to mid-1 otherwise we will find much larger value by finding it from mid+1 to right.

Thank you for your time I just tried my code but instead of defining my own power function I used Math.pow to get the power and it worked totally fine.