O(nlogn) PriorityQueue + Map Solution| Easy To UnderStand
Code

# Code
```java []
class Task{
    int userId,taskId, priority;
    boolean expired = false;
    Task(int userId,int taskId,int priority){
        this.userId = userId;
        this.taskId = taskId;
        this.priority = priority;
    }
}
class TaskManager {
    Map<Integer,Task> taskMap;
    PriorityQueue<Task> pQ;
    public TaskManager(List<List<Integer>> tasks) {
        //O(tlogt) t is length of tasks
        taskMap = new HashMap<>();
        pQ = new PriorityQueue<>(
            (a,b) -> b.priority-a.priority==0 ? 
            b.taskId-a.taskId : b.priority-a.priority
        );
        for(List<Integer> task : tasks){
            Task t = new Task(task.get(0),task.get(1),task.get(2));
            taskMap.put(t.taskId,t);
            pQ.offer(t);
        }
    }
    
    public void add(int userId, int taskId, int priority) {
        //O(logn)
        this.rmv(taskId);
        Task t = new Task(userId,taskId,priority);
        taskMap.put(taskId,t);//O(logn)
        pQ.offer(t);
    }
    
    public void edit(int taskId, int newPriority) { //O(logn)
        this.add(taskMap.get(taskId).userId,taskId,newPriority);
    }
    
    public void rmv(int taskId) {//O(1)
        if(taskMap.getOrDefault(taskId,null) != null){
            taskMap.get(taskId).expired = true;
        }
    }
    
    public int execTop() {//O(nlogn)
        Task t = null;
        while(pQ.size()>0 && (t=pQ.poll()).expired == true ){
        }
        if(t==null || t.expired)return -1;
        return t.userId;
    }
}

/**
 * Your TaskManager object will be instantiated and called as such:
 * TaskManager obj = new TaskManager(tasks);
 * obj.add(userId,taskId,priority);
 * obj.edit(taskId,newPriority);
 * obj.rmv(taskId);
 * int param_4 = obj.execTop();
 */
```
['Ordered Map', 'Heap (Priority Queue)', 'Java']