Help me for these two code of kth root

this is accepting all tc -->https://ide.codingblocks.com/s/339289

while this is not---->https://ide.codingblocks.com/s/339294

hello @kailash_01

image

pow(mid,k) can be a very big number (bigger than the range of long long)
so if u will try to store much bigger number in long long datatype then overflow will occur.
so to avoid it dont store its value anywhere.