Simple O(n) Python Solution [Beats 100%]
```\nclass Solution:\n    def minOperations(self, boxes: str) -> List[int]:\n        n = [0 for i in range(len(boxes))]\n        num_right = 0\n        num_left
```\nclass Solution:\n    def minOperations(self, boxes: str) -> List[int]:\n        n = [0 for i in range(len(boxes))]\n        num_right = 0\n        num_left = 0\n        for i in range(1,len(boxes)):\n            if(boxes[i] == "1"):\n                num_right += 1\n                n[0] += i\n        \n        for i in range(1, len(boxes)):\n            if(boxes[i-1] == "1"):\n                num_left += 1\n            n[i] = n[i-1]+num_left-num_right\n            if(boxes[i] == "1"):\n                num_right -= 1\n        return n\n
['Python']