Can you pls tell the error in the code, it is only passing one test case
Kth root question
hello @Tushar-Goel-1587999611286693
consider a case when k=1 and n=10^15.
in that case ur code will give wrong answer because ur range is not that big similarly when k=2.
how to rectify it.
see if k=1 then answer will always be n .
otherwise k>=2 our search space should be from 0 to sqrt(10^15).
so make these changes in ur code and it will work
But to check if the current ans is ans or not, I would have to find curr_ans^k<n:
yeah and for that use binary search.
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.