Kth Root of a number (in sorting and searching)

problem : given two integers n and k. Find the greatest integer x, such that, x^k <= n.

soln:https://ide.codingblocks.com/s/39100

can you tell me the mistake in it as i m only able to pass one test case

for the ans variable, change it to unsigned long long int

1 Like

Here is the final solution : https://ide.codingblocks.com/s/393872