java faster than 99%
\npublic int[] minOperations(String boxes) {\n        int sum=0;\n        int count=0;\n        int[] operation=new int[boxes.length()];\n        for(int i=0;i<
```\npublic int[] minOperations(String boxes) {\n        int sum=0;\n        int count=0;\n        int[] operation=new int[boxes.length()];\n        for(int i=0;i<boxes.length();i++){\n            operation[i]+=sum;\n            if(boxes.charAt(i)==\'1\'){\n                count++;\n            }\n            sum+=count;\n        }\n        sum=0;\n        count=0;\n        for(int i=boxes.length()-1;i>=0;i--){\n            operation[i]+=sum;\n            if(boxes.charAt(i)==\'1\'){\n                count++;\n            }\n            sum+=count;\n        }\n        return operation;\n    }\n```
['Java']