func plusMinus(arr: [Int]) -> Void {
let positives = Double(arr.filter {$0 > 0}.count)
let negatives = Double(arr.filter {$0 < 0}.count)
let zeros = Double(arr.filter {$0 == 0}.count)
let arrayCount = Double(arr.count)
print("\(positives/arrayCount)\n\(negatives/arrayCount)\n\(zeros/arrayCount)")
}
This repository has been archived by the owner on Dec 17, 2023. It is now read-only.