(val bool)
| 94 | } |
| 95 | |
| 96 | func (s *Stack) CountBool(val bool) int { |
| 97 | var count int |
| 98 | for _, e := range s.array { |
| 99 | if v, ok := e.(bool); ok && v == val { |
| 100 | count++ |
| 101 | } |
| 102 | } |
| 103 | return count |
| 104 | } |
| 105 | |
| 106 | func Swap(s *Stack, other *Stack) { |
| 107 | if s.Size() == 0 && other.Size() == 0 { |
no outgoing calls