Simple 2 line code | Easily Understandable | O(1) time complexity | Java | Beats 100%
Complexity
Time complexity:O(1)

Space complexity:O(1)
Code


# Complexity
- Time complexity:$$O(1)$$
<!-- 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 maxContainers(int n, int w, int maxWeight) {
        if(n*n*w < maxWeight) return (n*n);
        return maxWeight/w;
    }
}
```
['Java']