2244. Minimum Rounds to Complete All Tasks
Содержание
class Solution:
def minimumRounds(self, tasks: List[int]) -> int:
cnt = Counter(tasks)
res = 0
for v in cnt.values():
if v == 1:
return -1
res += v // 3 + (v % 3 != 0)
return res