Beats 100%. Simple solution
\n\n# Approach\nStep 1: count number of black balls till that index.\nStep 2: if there is a white ball, then to send it to the front, the current number of blac
\n\n# Approach\nStep 1: count number of black balls till that index.\nStep 2: if there is a white ball, then to send it to the front, the current number of black ball swaps are required.\n\n>\n\n# Code\n```java []\nclass Solution {\n    public long minimumSteps(String s) {\n        int b=0;\n        long sw=0;\n        for(char c: s.toCharArray()){\n            if(c==\'1\') b+=1;\n            else sw+=b;\n        }\n        return sw;\n    }\n}\n```
['Java']