Java | Two pointers | 7 lines | Clean code
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# Co
# 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```java []\nclass Solution {\n  public long minimumSteps(String s) {\n    var i = 0;\n    var res = 0L;\n\n    for (var j = 0; j < s.length(); j++) {\n      if (s.charAt(j) == \'0\') {\n        res += j - i;\n        i++;\n      }\n    }\n    return res;\n  }\n}\n```\nIf you like my solution, please upvote it!
['Two Pointers', 'String', 'Greedy', 'Java']