Simple list comprehension
Intuition\nThe given problem involves finding the total number of laser beams in a bank with security devices. The laser beams are formed between pairs of secur
# Intuition\nThe given problem involves finding the total number of laser beams in a bank with security devices. The laser beams are formed between pairs of security devices on different rows, and there should be no security devices in the rows between them.\n\n# Approach\nThe approach taken in the provided code is to first count the number of security devices in each row (\'D\'). Then, iterate through the counts and calculate the total number of laser beams by multiplying the counts of adjacent rows.\n\n# Complexity\n- Time complexity:O(n)\n- Space complexity:O(n)\n# Code\n```\nclass Solution:\n    def numberOfBeams(self, bank: List[str]) -> int:\n        C = 0\n        D=[i.count(\'1\') for i in bank if i.count(\'1\')!=0]\n        for i in range(len(D)-1):\n            C+=(D[i]*D[i+1])\n        return C\n```
['Python3']