• + 41 comments

    I failed case 6 several times before identifying the problem in my code. My problem was due to a mix use of int and long long. I thought I only needed int for the number being check and long long for its square. Turned out it was risky without careful casting, because when you assign the multiplication of two int's to a long long variable when the multiplication exceeds the int limit, the long long variable only gets the chunked portion available in the int bits. Hope this somehow contributes to the troubleshooting options.