✅ EASY JAVA SOLUTION || Easy peasy lemon squeezy || SIMPLE
\n# Code\n\nclass Solution {\n    public int numberOfBeams(String[] bank) {\n        int beams = 0;\n        int prev_num = 0;\n        int current_num = 0;\n  
\n# Code\n```\nclass Solution {\n    public int numberOfBeams(String[] bank) {\n        int beams = 0;\n        int prev_num = 0;\n        int current_num = 0;\n        for(int i=0;i<bank.length;i++){\n            current_num = countOnes(bank[i]);\n            beams += current_num*prev_num;\n            if(current_num != 0) prev_num = current_num;\n        }\n        return beams;\n    }\n\n    private int countOnes(String str){\n        int count = 0;\n        for(int i=0;i<str.length();i++){\n            if(str.charAt(i) == \'1\') count++;\n        }\n        return count;\n    }\n}\n\n\n```
['Java']