2244. Minimum Rounds to Complete All Tasks
Medium
You are given a 0-indexed integer array tasks
, where tasks[i]
represents the difficulty level of a task. In each round, you can complete either 2 or 3 tasks of the same difficulty level.
Return the minimum rounds required to complete all the tasks, or -1
if it is not possible to complete all the tasks.
Example 1:
Example 2:
Constraints:
1 <= tasks.length <= 105
1 <= tasks[i] <= 109
解題
Runtime: 146 ms, faster than 100.00%
Memory Usage: 9.1 MB, less than 87.76%
Last updated