Most elegant Kotlin solution
\n# Code\n\nclass Solution {\n    fun numberOfBeams(bank: Array<String>): Int {\n       return bank.map { row -> row.count { it == \'1\' } }\n                  
\n# Code\n```\nclass Solution {\n    fun numberOfBeams(bank: Array<String>): Int {\n       return bank.map { row -> row.count { it == \'1\' } }\n                  .filterNot { it == 0 }\n                  .zipWithNext { curr, next -> curr * next }\n                  .sum()\n    }\n}\n```
['Kotlin']