1class Solution {2public long taskSchedulerII(int[] tasks, int space) {3HashMap<Integer, Long> map = new HashMap<>();4long day = 0;56for (int item : tasks) {7if (map.containsKey(item) && map.get(item) > day) day = map.get(item);89day++;10map.put(item, day + space);11}1213return day;14}15}