MOST SIMPLE & OPTIMIZED || C++
Code\n\nclass Solution {\npublic:\n    int numberOfBeams(vector<string>& bank) {\n        int ans = 0,x=0,y=0;\n        for(auto &i: bank){\n            for(aut
# Code\n```\nclass Solution {\npublic:\n    int numberOfBeams(vector<string>& bank) {\n        int ans = 0,x=0,y=0;\n        for(auto &i: bank){\n            for(auto &j: i){\n                if(j==\'1\')x++;\n            }\n            if(x){\n                ans += (x*y);\n                y = x;\n                x = 0;\n            }\n        }\n        return ans;\n    }\n};\n```
['Math', 'String', 'Matrix', 'C++']