Problem Link:
My Solution:
Can you plz figure out what I am doing wrong? Problem seems to be very straight forward.
Problem Link:
My Solution:
Can you plz figure out what I am doing wrong? Problem seems to be very straight forward.
Hey @tasfikrahman007
while(str < y)
{
if(str * a < str + b )
{
str = a * str;
if (str < y)
exp++;
else {
str=str/a; //added this
break;
}
}
else
{
break;
}
}
Now it will give u 1 TLE for that avoid if else and directly do with while loop conditions
Hey @tasfikrahman007
while (str < (y/a) && (str * a < str + b))
Change it like this because a*str can overflow
Thank you so much bro, it got AC