I already tried the normal method, but I only clear 2/3 TC’s only, so I tried binary search method.But I am not getting the correct answer, can you please tell me what’s wrong with my code??
KTH ROOT Test cases not passed
Hi Ajith,
Instead of returning 0 at last return low-1 as in case when the highest power isn’t matched with mid,then low tends to the highest power.
I hope this will solve your doubt.
If any query still exists ask them here else mark it resolved.