Best Approach -O(n) time and O(1) space.
Intuition\nThe goal is to move all \'0\'s to the left side and all \'1\'s to the right side of the string. Each time we encounter a \'0\' that is out of place, 
# Intuition\nThe goal is to move all \'0\'s to the left side and all \'1\'s to the right side of the string. Each time we encounter a \'0\' that is out of place, it needs to swap with all the \'1\'s that were seen before it. Therefore, we need to keep track of how many \'1\'s we have encountered so far. For every \'0\' we find, we add the number of these \'1\'s to the total swap count.\n\n# Approach\n1. Initialize two variables:  \n   - `l_ones` to count how many \'1\'s we have seen so far.  \n   - `ans` to keep track of the total number of swaps needed.\n\n2. Traverse the string from left to right:  \n   - If the character is \'1\', increment `l_ones` by 1.  \n   - If the character is \'0\', add the current value of `l_ones` to `ans` because this \'0\' needs to swap with all the previously encountered \'1\'s.\n\n3. Return `ans` as the final result.\n\n# Complexity\n- Time complexity:  \n  O(n), where n is the length of the string.\n\n- Space complexity:  \n  O(1), since we only use a few extra variables.\n\n# Code\n```python3 []\nclass Solution:\n    def minimumSteps(self, s: str) -> int:\n        l_ones=0\n        ans=0\n        for i in s:\n            if i==\'1\':\n                l_ones+=1\n            elif i==\'0\':\n                ans+=l_ones\n        return ans\n        \n```
['String', 'Python3']