Kth root problem

sir my code is showing runtime exceeded error please correct it

Hi @Megha2468, Is this the code for kth root problem ?? It does’nt seems so


this one is

Hi @Megha2468, your logic is little flawed , ans variable stores the possible candidate to be an actual answer , also we have to find largest x which will satisfy the condition that x^k<=n;
so any number satisfying the above condition is a possible candidate ,even if it is not equal to n

refer to below code , u will understand what i mean

In case of any doubt feel free to ask :slight_smile:
mark your doubt as resolved if you got the answer