Browse Source

add a few aggregate functions for boolean slices

master
Alexander Avery 3 weeks ago
parent
commit
a262ed2747
  1. 19
      2024/aggregate.go

19
2024/aggregate.go

@ -0,0 +1,19 @@
package adventoc2024
func anyt(b []bool) bool {
for i := range b {
if b[i] {
return true
}
}
return false
}
func allt(b []bool) bool {
for i := range b {
if !b[i] {
return false
}
}
return true
}
Loading…
Cancel
Save