Here is my code. Why it is not passing all the test cases?
Problem in my code
Hey @yashsharma4304
long long m, n;
otherwise m*m or n*n will overflow
If this resolves your query then please mark it as resolved 
Oh so that was the problem of memory. Ok I understand, Thank you. 
1 Like