Free written solutionMinimum Rounds to Complete All Tasks (LeetCode 2244): Solution and Explanation
Each round finishes 2 or 3 tasks that share a difficulty level. Given tasks, return the fewest rounds that finish everything, or -1 if some task can never be placed in a round.
Read the intuition, approach, code and complexity →