Browse Source

leetcode 633

master
OhYee 2 years ago
parent
commit
4fcf0be061
Signed by: OhYee
GPG Key ID: 5A9E1F63ED274FBB
  1. 10
      leetcode/633/633.go

10
leetcode/633/633.go

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
func judgeSquareSum(c int) bool {
n := int(math.Sqrt(float64(c))) + 1
for a := 0; a <= n; a++ {
b := int(math.Sqrt(float64(c - a * a )))
if a * a + b * b == c {
return true
}
}
return false
}
Loading…
Cancel
Save