Set 
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

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

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

# Code
```cpp []
class TaskManager {
public:
    #define ll long
    map<ll,ll>present,userid;
   using vec=vector<ll>;
    set<vec,greater<>>pq;
    TaskManager(vector<vector<int>>& tasks) {
        for(int i=0;i<tasks.size();i++){
            present[tasks[i][1]]=tasks[i][2];
            pq.insert({tasks[i][2],tasks[i][1],tasks[i][0]});
            userid[tasks[i][1]]=tasks[i][0];
        }
    }
    void add(ll userId, ll taskId, ll priority) {
        present[taskId]=priority;
        userid[taskId]=userId;
        pq.insert({priority,taskId,userId});
    }
    
    void edit(ll taskId, ll newPriority) {
        pq.erase({present[taskId],taskId,userid[taskId]}); 
        present[taskId]=newPriority;
         pq.insert({newPriority,taskId,userid[taskId]});
    }
    
    void rmv(int taskId) {
        present.erase(taskId);
        userid.erase(taskId);   
    }
    int execTop() {
        while(pq.size()){
            auto top=*pq.begin();
            if(present.count(top[1])==0)
             pq.erase(pq.begin());
            else if(present[top[1]]!=top[0]){
                 pq.erase(pq.begin());
            }
            else break;
        }
        if(pq.size()==0)return -1;
        auto top=*pq.begin();
            pq.erase(pq.begin());
        return top[2];
    }
};

/**
 * 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)', 'Ordered Set', 'C++']