Predict the min number of boats required for different family travelling together. Boats have maximum limit of members allowed, members in a family should not be split. Multiple families can travel together in a boat. Boats can't be reused. XD
For Example:
Case 1. Input: limit = 3, people = [1,2] Output: 1 Explanation: 1 boat (1,2) # 2 family
Case 2. Input: limit = 3, people = [3,2,2,1] Output: 3 Explanation: 3 boats (1,2), (2) and (3) # 4 family