Company: uber_3sep
Difficulty: medium
Efficiency Scores Problem Description Uber's city infrastructure team is analyzing a network of service hubs across a metropolitan area. Each hub is connected to form a tree-like structure (no cycles, all hubs connected). Each hub is assigned a unique integer value that represents its operational efficiency score. Uber's operations team needs to answer multiple queries about sub-networks of hubs. Specifically, they want to count how many hubs within a given sub-network (including the queried hub itself and all hubs beneath it in the hierarchy) have a prime efficiency score. An efficiency score of 1 is not considered prime. Graph Construction (Network of Hubs) There are n hubs, numbered 1 through n . The hubs are connected with m = n - 1 undirected links, forming a tree. Hub 1 is always considered the main root hub of the network. Function Description Complete the function efficiencyScores in the editor with the following parameters: vector efficiencyScores(int n, vector first, vector s