I am a new developer and cannot seem to figure out how to find the number of True statements in an Array of Booleans. I know how to find by index but not by value. Any assis
Since you are dealing with an array of arrays, the computation will have two steps as well. First, use map to convert each inner array to its truth count, and then aggregate with reduce to obtain the final result:
let countTrue = before.map {$0.filter{$0}.count}.reduce(0, +)