Please solve the programming task below using a self-contained code snippet in a markdown code block.

You have some apples and a basket that can carry up to 5000 units of weight.
Given an integer array weight where weight[i] is the weight of the ith apple, return the maximum number of apples you can put in the basket.
 
Please complete the following python code precisely:
```python
class Solution:
    def maxNumberOfApples(self, weight: List[int]) -> int:
```