Add the maximum number of edges so no employee connects to more than max_connections special employees.
Unlock detailed company stats for this questionUpgrade
There are employee_nodes employees; k special employees share mobile hotspots over given bidirectional connections, so all employees connected to a special employee use that hotspot. Any employee may connect to at most max_connections special employees. Return the maximum number of edges that can be added to the graph (no self-loops or multiple edges; no two special employees are connected) such that the constraint holds. Complete getMaximumEdges(employee_nodes, employee_from[], employee_to[], special_employees[], max_connections). Example: 4 employees, edge 1-2, special {1,3}, max_connections=1 -> answer 2 (employee 4 can connect to 1 and 2).
Format · Microsoft SDE-2 round 2 DSA.
Community answers
No answers contributed by the community yet.
Related courses

Course

Course
Course
