Straight forward beginner friendly solution😊✅✅
Intuition:We need to load as many containers as possible without exceeding the maxWeight. Each container weighs w, and there are n containers available.Approach
### Intuition:
We need to load as many containers as possible without exceeding the `maxWeight`. Each container weighs `w`, and there are `n` containers available.

### Approach:
1. Start with `count = 0` and `wt = 0`.
2. While there are containers left and we can add one more without exceeding `maxWeight`, load the container.
3. Return the total number of containers loaded.

### Time Complexity:
- **O(n)** because we loop through the containers at most once.

### Space Complexity:
- **O(1)** because we use only a few variables.

### Code:

```cpp []
class Solution {
public:
    int maxContainers(int n, int w, int maxWeight) {
        int count = 0, wt = 0;
        while (n > 0) {
            if (wt + w <= maxWeight) {
                wt += w;
                count++;
            } else {
                break;
            }
            n--;
        }
        return count;
    }
};
```
``` Python []
class Solution:
    def maxContainers(self, n, w, maxWeight):
        count = 0
        wt = 0
        while n > 0:
            if wt + w <= maxWeight:
                wt += w
                count += 1
            else:
                break
            n -= 1
        return count

```
``` JavaScript []
class Solution {
    maxContainers(n, w, maxWeight) {
        let count = 0;
        let wt = 0;
        while (n > 0) {
            if (wt + w <= maxWeight) {
                wt += w;
                count++;
            } else {
                break;
            }
            n--;
        }
        return count;
    }
}

['Greedy', 'C++', 'Python3', 'JavaScript']