JAVA | 100% Beats | Two Pointer
\n# Code\njava []\nclass Solution {\n    public long minimumSteps(String s) {\n        long res = 0;\n        int idx = 0;\n\n        for (int i = 0 ; i < s.len
\n# Code\n```java []\nclass Solution {\n    public long minimumSteps(String s) {\n        long res = 0;\n        int idx = 0;\n\n        for (int i = 0 ; i < s.length() ; i++) {\n            char c = s.charAt(i);\n            if (c == \'0\') {\n                res += i - idx;\n                idx++;\n            }\n        }\n\n        return res;\n    }\n}\n```
['Two Pointers', 'String', 'Java']