Easy Implementation using PriorityQueue and HashMap-uh
Intuitionadd,edit,rmv operation can be done perfectly using HashMap and execTop can be done using PriorityQueue(maxHeap).P.S if you are unable to think of a sol
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
add,edit,rmv operation can be done perfectly using HashMap and execTop can be done using PriorityQueue(maxHeap).
P.S if you are unable to think of a solution, try solving 20-25 PriorityQueue problems on Leetcode, definately you will get better at building intuition. 

# Approach
<!-- Describe your approach to solving the problem. -->
Using HashMap and PriorityQueue(max Heap)

# Complexity
- Time complexity:O(n)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:O(n)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```java []
class TaskManager {
    Map<Integer, Integer[]> taskManagerMap;
    PriorityQueue<int[]> maxHeap ;

    public TaskManager(List<List<Integer>> tasks) {
        taskManagerMap = new HashMap<>();
        maxHeap = new PriorityQueue<>((a,b) -> a[0] != b[0] ? b[0] - a[0] : b[1]-a[1]) ;
        for(List<Integer> list : tasks){
            taskManagerMap.put(list.get(1), new Integer[] {list.get(0), list.get(2)}); // taskId, arrayOf(userId, priority)
            maxHeap.add(new int[] {list.get(2), list.get(1)});  //priority, taskId
        }
    }
    

    public void add(int userId, int taskId, int priority) {
        taskManagerMap.put(taskId, new Integer[] {userId, priority});
        maxHeap.add(new int[] {priority, taskId});  //priority, taskId
    }

    public void edit(int taskId, int newPriority) {
        Integer arr[] = taskManagerMap.get(taskId);
        arr[1] = newPriority ;
        taskManagerMap.put(taskId, arr);
        maxHeap.add(new int[] {newPriority, taskId});  //priority, taskId
    }

    public void rmv(int taskId) {
        taskManagerMap.remove(taskId);
    }

    public int execTop() {
        while(maxHeap.size()>0){
            int heapArr[] = maxHeap.poll();
            if(taskManagerMap.containsKey(heapArr[1])){ //check if taskId exist in the map
                Integer mapArray[] = taskManagerMap.get(heapArr[1]); // if taskId exist compares the Priority
                if(mapArray[1] == heapArr[0]){ // compares taskManagerMap Priority with maxHeap Priority
                    taskManagerMap.remove(heapArr[1]); //remove entry from map
                    return mapArray[0];// return userID
                }
            }
        }
        return -1;
    }
}

/**
 * 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();
 */
```
['Java']