Given Employee-Manager pair in HashMap and a manager, print all employee managed by the given manager.

  • 0
    public static List<String> findEmployee(HashMap<String,String> relation,String manager)

    We need to return all employees in the manager's report of command. I came up with reverse map and then BFS/DFS solution. Is there any other optimized solution for this ?

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.