Minimum Number of Operations to Move All Balls to Each Box
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```java []
class Solution {
    public int[] minOperations(String boxes) {
        int arr[]=new int[boxes.length()];
        
        for(int i=0;i<boxes.length();i++){
            int a=0;
            for(int j=0;j<boxes.length();j++){
                if(i==j){
                    continue;
                }
                if(boxes.charAt(j)=='1'){
                    a+=Math.abs(j-i);
                }
            }
            arr[i]=a;
        }
        return arr;
    }
}
```
['Java']