**Problem Statement:**
Given the required input arguments, write an efficient algorithm to solve the **Task Scheduler** problem. Implement the required logic as specified by standard definitions for this classic algorithmic challenge.
**Hint / Expected Approach:**
Max-heap + cooldown idle slots or formula
**Edge Cases to Consider:**
- (1) n = 0 (no cooldown)
- (2) All same tasks
- (3) k = 1 task