✔️ 👨‍💻 C++ Simple Soln
this question in Hindi  Haathi k daat dikhane k aur and khaane k aur\nExplanation\ncalculate the sum of bits and if sum is zero than copy previous to that zero\
this question in Hindi  *Haathi k daat dikhane k aur and khaane k aur*\n*Explanation*\ncalculate the sum of bits and if sum is zero than copy previous to that zero\n```\n    int sumbit(string s){\n        int count=0;\n        for(auto ch:s)\n        {\n            if(ch==\'1\') count++;\n        }\n        return count;\n    }\n     vector<int> makevec(vector<string>& bank)\n     {\n         vector<int> vec;\n         for(auto str:bank)\n         {\n             vec.push_back(sumbit(str));\n         }\n         return vec;\n     }     \n    int numberOfBeams(vector<string>& bank) {\n         int ans=0;\n         vector<int> vec=makevec(bank);\n         for(int i=0;i<vec.size()-1;i++){\n             if(vec[i+1]){\n                 ans+=vec[i]*vec[i+1];\n             }else{\n                 vec[i+1]=vec[i];\n             }\n         }\n         return ans;\n     }\n\n```\n##### If you like this solution, do **UPVOTE**.\n##### Feel free to ask any **doubts** in the comment section.\n##### Happy Coding :)
[]