def isPerfectSquare(n):
    return n > 0 and n == math.floor(math.sqrt(n))**2 
