Simple Greedy Solution with DRY Run (^///^)
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \niterate from right to l
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\niterate from right to left, count the number of zeros that have already happened. Add that counter to the answer each time when we iterate from 1 to 1.\n![image.png](https://assets.leetcode.com/users/images/1f90474d-5855-40df-9b0b-3eecfa043b05_1700370706.8565476.png)\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ --> O(n)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->O(1)\n# Code\n```\nclass Solution:\n    def minimumSteps(self, s: str) -> int:\n        count , ans = 0 , 0\n        for i in range(len(s)-1 ,-1 , -1):\n            if s[i] == \'0\':\n                count += 1 \n            else:\n                ans += count\n        return ans \n```
['Greedy', 'Python3']