very simple solution | easy to understand
\nclass Solution:\n    def numberOfBeams(self, bank: List[str]) -> int:\n        prev, ans = 0, 0\n        for i in bank:\n            current = i.count(\'1\')\
```\nclass Solution:\n    def numberOfBeams(self, bank: List[str]) -> int:\n        prev, ans = 0, 0\n        for i in bank:\n            current = i.count(\'1\')\n            if current:\n                ans += prev * current\n                prev = current\n        return ans\n```
['Python', 'Python3']