Verify Prime Swift Solution


#1

func isPrime(_ A: inout Int) -> Int {
if A < 2 { return 0 }
if A < 4 { return 1 }
for i in 2…Int(sqrt(Double(A))) {
if A % i == 0 {
return 0
}
}
return 1
}