Java Easy Consise Beginer Friendly
\nclass Solution {\n    public int[] minOperations(String boxes) {\n        int[] res = new int[boxes.length()];\n        List<Integer> list = new ArrayList<>()
```\nclass Solution {\n    public int[] minOperations(String boxes) {\n        int[] res = new int[boxes.length()];\n        List<Integer> list = new ArrayList<>();\n        for(int i=0;i<boxes.length();i++) if(boxes.charAt(i) == \'1\') list.add(i);\n        for(int i=0;i<res.length;i++) for(int idx:list) res[i] += Math.abs(idx - i);\n        return res;\n    }\n}\n```
['Java']