cannot understand KTH ROOT question what the question want to do
Cannot understand KTH ROOT question what the question want to do
@sroy3166
hello Sourav,
In this question u need to find largest value of x which satisfies this condition x^k <=n
where k and n are given constant.
ex -> if k=3 and n=9
then 1^3 <=9 (so 1 is possible)
2^3 <=9 ( 2 is also possible)
so our answer will be 2. ( 2 is largest x which satisfies x^k <=n condition)
whats the mistake that i make in this question…my output is right but can’t pass any of the test cases
hello @sroy3166
a ) shirnk the range of search space to avoid overflow.
b) handle the case for k=1 (as answer will always be n for this case)
c) dont use pow function to calculate pow(mid,k) .
compute it using loop and during iteration at any point mid^i exceeds n .
break the loop and perform execution accordingly