Javascript one-liner
\n/**\n * @param {string[]} bank\n * @return {number}\n */\nconst numberOfBeams = (bank) =>\n    bank\n        .map((str) => str.split("0").join("").length)\n  
```\n/**\n * @param {string[]} bank\n * @return {number}\n */\nconst numberOfBeams = (bank) =>\n    bank\n        .map((str) => str.split("0").join("").length)\n        .filter((val) => val !== 0)\n        .reduce((acc, cur, ind, arr) => acc + cur * (arr[ind + 1] || 0), 0);\n```\n
['JavaScript']