Simple Java solution but time limit exceeded


  • -1
    U
    public boolean judgeSquareSum(int c) {
            for(int i=0; i<=c; i++)
                for(int j=0; j<=c; j++)
                    if(i*i+j*j == c) return true;
        return false;
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.