Begineer Friendly Solution
\nclass Solution {\n    public int numberOfBeams(String[] bank) {\n        int ans = 0;\n        int prevArrLaserCount = 0;\n        \n        // iterate throug
```\nclass Solution {\n    public int numberOfBeams(String[] bank) {\n        int ans = 0;\n        int prevArrLaserCount = 0;\n        \n        // iterate through bank array\n        for(var i : bank){\n            int curArrLaserCount = 0;\n            // for finding the count of each string\n            for(var j : i.toCharArray()){\n                if(j == \'1\'){\n                    curArrLaserCount++;\n                }\n            }\n            // if value is greater than zero then we multiply\n            if(curArrLaserCount>0){\n                ans += prevArrLaserCount * curArrLaserCount;\n                prevArrLaserCount = curArrLaserCount;\n            }\n        }\n        \n        return ans;\n    }\n}\n```
['String', 'Java']