2 Pointer | Concise Code
Complexity\n- Time complexity: O(n) \n\n- Space complexity: O(1) \n\n# Code\npython3 []\nclass Solution:\n    def minimumSteps(self, s: str) -> int:\n        le
# Complexity\n- Time complexity: $$O(n)$$ \n\n- Space complexity: $$O(1)$$ \n\n# Code\n```python3 []\nclass Solution:\n    def minimumSteps(self, s: str) -> int:\n        left = 0\n        right = len(s) - 1\n        ans = 0\n\n        while left < right:\n            if s[right] == "1":\n                right -= 1\n                continue\n            if s[left] == "0":\n                left += 1\n                continue\n            ans += right - left\n            left += 1\n            right -= 1\n\n        return ans\n\n```
['Two Pointers', 'Python3']