Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def total_time(heroes: list, n: int):
- heroes.reverse()
- current = []
- for _ in range(n):
- heapq.heappush(current, heroes.pop())
- while heroes:
- x = heapq.heappop(current)
- heapq.heappush(current, x + heroes.pop())
- return max(current)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement