Python 3   ||   3 lines,  with explanation  ||   T/S: 92% / 15%
Here\'s the intuition:\n- The problem is equivalent to determining the number of swaps to move all 0s to the left.\n- Thus, that number of moves is the differen
Here\'s the intuition:\n- The problem is equivalent to determining the number of swaps to move all *0*s to the left.\n- Thus, that number of moves is the difference between the sum of the indices of the *0*s\' in their present positions and the sum of the indices of the same count of the leftmost positions in the string.\n\nIf you know some algebra, you can figure it out from that.\n```python3 []\nclass Solution:\n    def minimumSteps(self, s: str) -> int:\n\n        idxs = [i for i, ch in enumerate(s) if ch == \'0\']\n        sm, cnt = sum(idxs), len(idxs)\n\n        return sm - cnt*(cnt-1)//2\n```\n\n[https://leetcode.com/problems/separate-black-and-white-balls/submissions/1295286429/](https://leetcode.com/problems/separate-black-and-white-balls/submissions/1295286429/)\n\nI could be wrong, but I think that time complexity is *O*(*N*) and space complexity is *O*(*Z*), in which *N* ~ `len(s)` and *Z* ~  count of *0*s in `s`
['Python3']