// It's the unique ID of each node.
// unique id of this employee
// the importance value of this employee
// the id of direct subordinates
vector<int> subordinates;
int getIndex(vector<Employee*> employees, int id)
for(int i=0;i<employees.size();i++)
if(employees[i]->id ==id)
int getImportance(vector<Employee*> employees, int id) {
int ind=getIndex(employees,id);
int res=employees[ind]->importance;
for(auto i: employees[ind]->subordinates)
int n=getIndex(employees,i);
if(employees[n]->subordinates.empty())
res+= employees[n]->importance;
res+=getImportance(employees,employees[n]->id);