Why getting TLE in MULTHREE

my solution
why its getting TLE?
the for loop in it runs for 2-4 times only!

Think if a+b = 10, what will happen for very large k.

1 Like

if(j will not become 2) then loop will never break;
so for k<pow(10,12)
it will give tle

1 Like

thanks, got the error