2362. Minimum Rounds to Complete All Tasks
My accepted Python solution to LeetCode problem 2362, Minimum Rounds to Complete All Tasks, running in 39ms.
- Difficulty: Medium
- Python
- Runtime 39ms
- Memory 33MB
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
Python
Accepted on LeetCode — runtime 39ms, memory 33MB, accepted 2026-01-02.
class Solution:
def minimumRounds(self, tasks: List[int]) -> int:
from collections import Counter
count = Counter(tasks)
result = 0
for freq in count.values():
if freq == 1:
return -1
# Use as many 3s as possible
result += (freq + 2) // 3
return result