you data structure employee information include employee unique ID importance value direct subordinate idsyou give array employee employee whereemployeesiid ID ith employeeemployeesiimportance importance value ith employeeemployeesisubordinates list id direct subordinate ith employeeGiven integer i d represent employee ID return total importance value employee direct indirect subordinate Example 1input employee 15232333 i d 1output 11explanation employee 1 importance value 5 direct subordinate employee 2 employee 3they importance value 3thus total importance value employee 1 5 3 3 11example 2input employee 12553 i d 5output 3explanation employee 5 importance value 3 direct subordinatesthus total importance value employee 5 3 Constraints1 employeeslength 20001 employeesiid 2000All employeesiid unique100 employeesiimportance 100one employee direct leader subordinatesthe id employeesisubordinate valid id