easy c++ solution
\'\'\'\nclass Solution {\npublic:\n    int numberOfBeams(vector& bank) {\n         int prev=0,row=0,ans=0;\n        for(int i=0;i<bank.size();i++){\n           
\'\'\'\nclass Solution {\npublic:\n    int numberOfBeams(vector<string>& bank) {\n         int prev=0,row=0,ans=0;\n        for(int i=0;i<bank.size();i++){\n            row=0;\n            for(int j=0;j<bank[0].size();j++){\n                if(bank[i][j]==\'1\') row++;\n            }\n            ans+=row*prev;\n            if(row>0) prev=row;\n        }\n        return ans;\n    }\n};\n
['C', 'C++']