Smart Number 2

Sort by

recency

|

35 Discussions

|

  • + 0 comments

    def is_smart_number(num):

    val = int(math.sqrt(num))
    if **num == int(math.pow(val , 2))**:
        return True
    return False
    
  • + 0 comments

    Only square numbers have odd factors.

  • + 0 comments

    Java 7

            if (num == val * val)
    
  • + 0 comments

    C++ solution

    bool is_smart_number(int num) {
        int val = (int) sqrt(num);
        if(num==1 || (num>=4 && val>1 && num == val*val))
            return true;
        return false;
    }
    
  • + 3 comments

    I'm having an issue where my output and the expected output are exactly identical, but the grader is saying I have the wrong answer.

    Has anyone else had this issue?