Kth root player

TLE on one test case(middle one).
Don’t know how can i optimize this one .

code : https://ide.codingblocks.com/s/49006
ques : https://online.codingblocks.com/player/12348/content/4855

Hey Harshit, this problem is a good implementation of binary search. Try a lil bit more on how you can optimize your code using binary search, If still you will be unable to figure out, do let me know. I will help you out with the binary search technique for finding the Kth root.

1 Like

https://ide.codingblocks.com/s/49022

I changed the code a bit and now all the test cases are correct.
I haven’t used binary search though.
Is it fine ?

It’s fine but you can still improve the efficiency by using binary search.

1 Like