Sum of perfect squares

I used bottom up approach to solve this problem. I am getting TLE for the last test case.

Hey @nidhigupta847
Please share your code

Hey @nidhigupta847
Replace min function by this
if(dp[i]>(1+dp[i-(j*j)]))
dp[i]=1+dp[i-(j*j)];
And it will run ,constraints must be really tight on this one
removing min function reduces function overheads(time to call ,pass etc)

Still showing TLE for the last test case

Share your code again.

Try submitting the same two three times.