Medium
Given an array nums where nums[i] is the time a bus takes for one trip, and an integer target (the total number of trips required by all buses combined), return the minimum time needed for the buses to complete at least target trips. Buses run independently and in parallel.
Input: nums = [1,2,3], target = 5 Output: 3
Input: nums = [2], target = 1 Output: 2