Original problem : https://leetcode.com/problems/task-scheduler/
Consider that you are given an additional constraint on this problem which asks you to assume a cooldown period which can vary according to the task.
Instead of a single integer n you are given a map which represents the task along with it's cooldown duration.
Input seq : ABAB
cool down time :
coolDownMap.put('A',3);
coolDownMap.put('B',2);
coolDownMap.put('C',1);
coolDownMap.put('D',2);
Here 1st A will execute in 1 unit of time . Total Time = 1
Seq AAA : output ->9
Seq ABCD : output -> 4
Any ideas on this one would be really helpful :)