Simple Python3 Solution
\nclass Solution:\n    def minOperations(self, boxes: str) -> List[int]:\n        arr = []\n        \n        for i, balls in enumerate(boxes):\n            if 
```\nclass Solution:\n    def minOperations(self, boxes: str) -> List[int]:\n        arr = []\n        \n        for i, balls in enumerate(boxes):\n            if balls == \'1\':\n                arr.append(i)\n        \n        res = []\n        for i in range(len(boxes)):\n            tmp = 0\n            for index in arr:\n                tmp += abs(i - index)\n            res.append(tmp)\n            \n        return res\n```
['Python3']