Java Easy Solution
\nclass Solution {\n    public int[] minOperations(String boxes) {\n         int[] min=new int[boxes.length()];\n        List<Integer> ans=new ArrayList<>();\n 
```\nclass Solution {\n    public int[] minOperations(String boxes) {\n         int[] min=new int[boxes.length()];\n        List<Integer> ans=new ArrayList<>();\n        List<Integer> ind=new ArrayList<>();\n        for(int i=0;i<boxes.length();i++){\n            if(boxes.charAt(i)==\'1\'){\n                ind.add(i);\n            }\n        }\n        for(int i=0;i<boxes.length();i++){\n            \n                int temp=0;\n                for(int j=0;j<ind.size();j++){\n                    temp+=Math.abs(i-ind.get(j));\n                }\n                min[i]=temp;\n            \n        }\n        \n        return min;\n        \n    }\n}\n```
[]