Simplest JAVA Code, Beats 100% Time and Space
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\n# Complexity\n- Tim
# 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\n# Complexity\n- Time complexity: O(n)\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public long minimumSteps(String s) {\n        int j = 0;\n        long count = 0;\n        for(int i=0;i<s.length();i++){\n            if(s.charAt(i) == \'0\'){\n                count += i - j;\n                j++;\n            }\n        }\n        return count;\n    }\n}\n```
['Java']