Easy to understand😊| beginner's friendly 😁😁🎆🎆
Intuition Count number of 1\'s and add them to the ans.\n Describe your first thoughts on how to solve this problem. \n\n## Approach:  Check the count of \'1\' 
# Intuition Count number of 1\'s and add them to the ans.\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n## Approach:  *Check the count of \'1\' in bank[i] and if count != 0 push it into the vector to store the 1\'s count in bank[i] using two for loops. After that iterate on vector and add the multiplication of v[i] & v[i+1] in the ans(A.T.Q), return ans*\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: O(n^2)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:o(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int numberOfBeams(vector<string>& bank) {\n        vector<int> v;\n\n        for(int i =0; i<bank.size(); i++){\n            int cnt=0;\n            for(int j =0; j< bank[i].size(); j++){\n                if(bank[i][j] ==\'1\')\n                cnt++;\n            }\n            if(cnt!= 0) v.push_back(cnt);\n        }\n        int ans=0;\n        if(v.empty()) return 0;\n        for(int i =0; i< v.size()-1; i++){\n            ans+= v[i]*v[i+1];\n        }\n        return ans;\n    }\n};\n```
['C++']