Simple calculation in One Pass
Code\npython3 []\nclass Solution:\n    def minimumSteps(self, s: str) -> int:\n        res, swaps = 0, 0\n        for ch in s:\n            if ch == \'1\':\n   
# Code\n```python3 []\nclass Solution:\n    def minimumSteps(self, s: str) -> int:\n        res, swaps = 0, 0\n        for ch in s:\n            if ch == \'1\':\n                swaps += 1\n            else:\n                res += swaps\n        return res     \n        \n```
['Python3']