Go 100% time and 100% space | O(n*m)
\nfunc numberOfBeams(bank []string) int {\n\tprevBits, currentBits, result := 0, 0, 0\n\tfor i := 0; i < len(bank); i++ {\n\t\tif currentBits = countBits(bank[i
```\nfunc numberOfBeams(bank []string) int {\n\tprevBits, currentBits, result := 0, 0, 0\n\tfor i := 0; i < len(bank); i++ {\n\t\tif currentBits = countBits(bank[i]); currentBits != 0 {\n\t\t\tresult += prevBits * currentBits\n\t\t\tprevBits = currentBits\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc countBits(s string) int {\n\tresult := 0\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] == \'1\' {\n\t\t\tresult++\n\t\t}\n\t}\n\n\treturn result\n}\n```
['Go']