easy to understand solution
Intuition\nwe will iterate from right if we encounter 0 then add it to number of zero \nif we encounter 1 we will add the number of zero to its right to the ans
# Intuition\nwe will iterate from right if we encounter 0 then add it to number of zero \nif we encounter 1 we will add the number of zero to its right to the ans\n# Approach\n<!-- Describe your approach to solving the problem. -->\nwe are doing this because every zero to the right of 1 will be swapped once hence we are adding it answer. it is like we are grouping all 0 together from right and then moving towards the start and if we encounter 1 we are moving that one from the whole group of zeros to right\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(N)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(1)\n# Code\n```cpp []\nclass Solution {\npublic:\n    long long minimumSteps(string s) {\n        int zero=0;\n        long long ans=0;\n        for(int i=s.size()-1;i>=0;i--){\n            if(s[i]==\'0\') zero++;\n            else ans+=zero;\n        }\n        return ans;\n    }\n};\n```
['String', 'Greedy', 'C++']