Medium
You are given weights nums and a boat capacity target. Each boat carries at most two people whose combined weight is at most target. Return the minimum number of boats to carry everyone.
Input: people = [1,2], limit = 3 Output: 1
Input: people = [3,2,2,1], limit = 3 Output: 3
Input: people = [3,5,3,4], limit = 5 Output: 4