Calculate Raft Requirement

Python function to find the minimal number of rafts needed for whitewater rafting event considering weight limit.

In a whitewater rafting event, each participant has a weight, represented as `weights[i]` for the `i-th` participant. Every raft can carry a maximum of two participants at a time, but their combined weight must be within the `limit`. Your task is to define a function that calculates and returns the least number of rafts required for all participants to partake in the event. ### Parameters - `weights` (list of integers): A list that represents the weights of the participants. - `limit` (integer): An integer that represents the maximum weight that a raft can carry. ### Return Value - Returns an integer, which represents the minimum number of rafts needed for all participants to engage in the event. ### Examples ```python # There are 3 participants with weights [1,2,3], and each raft can carry a maximum of 3 weight units. solution([1,2,3],3) # Returns: 2 # There are 5 participants with weights [90,80,150,120,100], and each raft can carry a maximum of 200 weight units. solution([90,80,150,120,100],200) # Returns: 3 # There are 6 participants with weights [200,220,120,110,170,150], and each raft can carry a maximum of 300 weight units. solution([200,220,120,110,170,150],300) # Returns: 4 ```