very bad approach || sorry for posting
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int numberOfBeams(vector<string>& b) {\n        int n=b.size(),m=b[0].size(),ans=0,i=0;\n        while(i<n){\n            int cnt1=0,cnt2=0;\n            for(int j=0;j<m;j++){\n                if(b[i][j]==\'1\')cnt1++;\n            }\n            if(!cnt1){\n                i++;\n                continue;\n            }\n            int j=i+1;\n            while(j<n){\n                for(int k=0;k<m;k++){\n                    if(b[j][k]==\'1\')cnt2++;\n                }\n                if(cnt2)break;\n                j++;\n            }\n            ans+=cnt1*cnt2;\n            i=j;\n        }\n        return ans;\n    }\n};\n```
['C++']