Simple Kotlin solution for beginners
\nclass Solution {\n    fun numberOfBeams(bank: Array<String>): Int {\n        var result = 0\n        var prev = 0\n        for (floor in bank) {\n            
```\nclass Solution {\n    fun numberOfBeams(bank: Array<String>): Int {\n        var result = 0\n        var prev = 0\n        for (floor in bank) {\n            val curr = floor.count { it == \'1\'}\n            if (curr != 0) {\n                result += prev*curr\n                prev = curr\n            }\n        }\n        return result\n    }\n}\n```
['Kotlin']