some hint please…
Some hint please
See this problem , when you have k ==1 , then of course minimum value of x which will make x equal to n is n only.
Or else what, 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.
but how to calculate mid^k when mid comes to be very large?
Store it in long long int, the test cases will be handled by this data type only
how ?? I mean I’ll get mid very large 1000000000000000 10 for this case
Check this
Have added cmnts for better understanding.
thank you …
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.