func isPerfectSquare(num int) bool { n := 1 for { s := n * n if s == num { return true } if s > num { break } n++ } return false }