HI,
I'm trying to do this problem and getting TLE. I'm checking if the number's square root is a number or not. If it is then, total number of factors are odd otherwise even.
Here is the code:
func isPerfectSquare( n int ) int {
squareRoot := int( math.Sqrt( float64( n ) ) )
if squareRoot * squareRoot == n {
return 1
} else {
return 0
}
}
Can somebody help me out with this. Link to the problem: http://www.spoj.com/problems/SINEGGS/