package leetcode;

import java.util.Arrays;

/**
 * https://leetcode.com/problems/minimum-number-of-operations-to-move-all-balls-to-each-box/
 */
public class Problem1769 {
    public int[] minOperations(String boxes) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem1769 prob = new Problem1769();
        System.out.println(Arrays.toString(prob.minOperations("110"))); // [1,1,3]
        System.out.println(Arrays.toString(prob.minOperations("001011"))); // [11,8,5,4,3,4]
    }
}

@@ -225,35 +225,403 @@
     
-// TODO%0A        return null
+int%5B%5D answer = new int%5Bboxes.length()%5D;%0A        for (int i = 0; i %3C boxes.length(); i++) %7B%0A            int count = 0;%0A            for (int j = 0; j %3C boxes.length(); j++) %7B%0A                if (j == i %7C%7C boxes.charAt(j) == '0') %7B%0A                    continue;%0A                %7D%0A                count += Math.abs(i - j);%0A            %7D%0A            answer%5Bi%5D = count;%0A        %7D%0A        return answer
 ;%0A  

Update problem 1769