<p>给你一个数组 <code>time</code> ,其中 <code>time[i]</code> 表示第 <code>i</code> 辆公交车完成 <strong>一趟</strong><strong>旅途</strong> 所需要花费的时间。</p> <p>每辆公交车可以 <strong>连续</strong> 完成多趟旅途,也就是说,一辆公交车当前旅途完成后,可以 <strong>立马开始</strong> 下一趟旅途。每辆公交车 <strong>独立</strong> 运行,也就是说可以同时有多辆公交车在运行且互不影响。</p> <p>给你一个整数 <code>totalTrips</code> ,表示所有公交车 <strong>总共</strong> 需要完成的旅途数目。请你返回完成 <strong>至少</strong> <code>totalTrips</code> 趟旅途需要花费的 <strong>最少</strong> 时间。</p> <p> </p> <p><strong>示例 1:</strong></p> <pre><b>输入:</b>time = [1,2,3], totalTrips = 5 <b>输出:</b>3 <strong>解释:</strong> - 时刻 t = 1 ,每辆公交车完成的旅途数分别为 [1,0,0] 。 已完成的总旅途数为 1 + 0 + 0 = 1 。 - 时刻 t = 2 ,每辆公交车完成的旅途数分别为 [2,1,0] 。 已完成的总旅途数为 2 + 1 + 0 = 3 。 - 时刻 t = 3 ,每辆公交车完成的旅途数分别为 [3,1,1] 。 已完成的总旅途数为 3 + 1 + 1 = 5 。 所以总共完成至少 5 趟旅途的最少时间为 3 。 </pre> <p><strong>示例 2:</strong></p> <pre><b>输入:</b>time = [2], totalTrips = 1 <b>输出:</b>2 <strong>解释:</strong> 只有一辆公交车,它将在时刻 t = 2 完成第一趟旅途。 所以完成 1 趟旅途的最少时间为 2 。 </pre> <p> </p> <p><strong>提示:</strong></p> <ul> <li><code>1 <= time.length <= 10<sup>5</sup></code></li> <li><code>1 <= time[i], totalTrips <= 10<sup>7</sup></code></li> </ul>