EASY SOLUTION JUST USING FOR LOOP!!!!!
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(N*N)\n\n- Space complexity:\n(1)\n\n# Code\n```\nauto speedUp = [](){\n    ios::sync_with_stdio(false);\n    cin.tie(0);\n    cout.tie(0);\n    return 0;\n}();\nclass Solution {\npublic:\n    int numberOfBeams(vector<string>& bank) {\n        int n = bank.size(), ans = 0;\n        int first = count(bank[0].begin(),bank[0].end(),\'1\');\n        for(int i = 1; i < n; i++)\n        {\n            int second = count(bank[i].begin(),bank[i].end(),\'1\');\n            ans = ans + first*second;\n            if (second != 0)\n            {\n                first = second;\n            }\n        }\n        return ans;\n    }\n};\n\n```\n![upvoteimageforleetcodeimportant.png](https://assets.leetcode.com/users/images/50a11e63-fe14-4ee0-85b3-d014393fd2de_1704278711.8692863.png)\n
['C++']