Python3
\nclass Solution:\n    def numberOfBeams(self, bank: List[str]) -> int:\n        su = 0\n        a = []\n        for i in range(len(bank)):\n            count =
```\nclass Solution:\n    def numberOfBeams(self, bank: List[str]) -> int:\n        su = 0\n        a = []\n        for i in range(len(bank)):\n            count = 0\n            for j in range(len(bank[i])):\n                if bank[i][j]==\'1\':\n                    count+=1\n            if count>0:\n                a.append(count)\n        if len(a)<=1:\n            return 0\n        else:\n            for i in range(len(a)-1):\n                su+=a[i]*a[i+1]\n        return su\n```
['Python3']