Trivial c++ 5 lines
Approach\nCalculate and accumulate the offset for each found \'0\'.\n\n# Complexity\n- Time complexity:\nO(n)\n\n- Space complexity:\nO(1)\n\n# Code\ncpp []\nlo
# Approach\nCalculate and accumulate the offset for each found `\'0\'`.\n\n# Complexity\n- Time complexity:\n$$O(n)$$\n\n- Space complexity:\n$$O(1)$$\n\n# Code\n```cpp []\nlong long minimumSteps(string s) {\n    int64_t ans = 0;\n    for (int i = 0, c = 0; i < s.size(); i++)\n        if (s[i] == \'0\')\n            ans += i - c++;\n    return ans;\n}\n```
['C++']