C++ || No explanation needed
\nclass Solution {\npublic:\n    int numberOfBeams(vector<string>& bank) {\n    int pre=0;\n        int cur=0;\n        int ans=0;\n        for(auto &a:bank){\n
```\nclass Solution {\npublic:\n    int numberOfBeams(vector<string>& bank) {\n    int pre=0;\n        int cur=0;\n        int ans=0;\n        for(auto &a:bank){\n            cur=count(a.begin(),a.end(),\'1\');\n            if(cur!=0){\n                ans+=pre*cur;\n                pre=cur;\n            }\n        }\n       return ans;\n    }\n};\n```
['C++']