Given a set of tasks, and int k, which is the waiting time between two same tasks. Calculate the min total execution time if you are allowed to rearrange the tasks. Assume the execution for each individual task is 1.
Example:
Input: tasks = [A A B], k = 1
Output: 3
Explanation:
Without rearrangement, the execution time would be 4:
A wait A B
1 1 1 1
With rearrangement, the execution time would be 3:
A B A
1 1 1Related problems:
Comments (11)

