Java🍵|Brute Force🔥|Easy✅
Complexity
Time complexity: O(n*n)

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

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

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