• + 1 comment

    I didn't understand the approch they want to do. so I think in my way and make changes in a single line of that code. though my output and expected output are same. It's still showing wrong answer. So, I think it not only watching for the output but also watching for whitch line and what changed. Here is my first approch.

    def is_smart_number(num):
        val = num if len([i for i in range(1, num+1) if num % i==0]) % 2 !=0 else num+1
        if num / val == 1:
            return True
        return False
    

    and here is the expected approch.

    def is_smart_number(num):
        val = int(math.sqrt(num))
        if val * val == num:
            return True
        return False