SIMPLE TWO-POINTER C++ SOLUTION O(N),O(1)
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:o(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:o(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n#define ll long long \nclass Solution {\npublic:\n    long long minimumSteps(string s) {\n      ll ans = 0;\n        ll ones = 0; \n        //\n         // Dry run for "100":\n    // - i = 0, s[i] = \'1\', ones = 1\n    // - i = 1, s[i] = \'0\', ans = 1 // so we need to swap 100 => 010 so inorder to swap it we requre 1 operation, \n    // - i = 2, s[i] = \'0\', ans = 2 (one \'1\' to the right of this \'0\')// 010 => 001\n        ll n = s.size();\n        for(ll i = 0;i<n;i++){\n            if(s[i]==\'1\')   \n                ones++;\n            else{\n                ans+=ones;\n            }\n        }\n        return ans;\n    }\n};\n```
['C++']