Company: uber_3sep
Difficulty: medium
Connected Sum Problem Description You are working on Uber's driver network analysis system, which models drivers as nodes in a graph. A connection (edge) exists between two drivers if they frequently operate in the same area or share rides in pooled trips. Uber wants to analyze these connected groups of drivers (connected components) to optimize demand prediction and driver incentives. Each connected group of drivers is a connected component. The order of a component is the number of drivers in it. For each component, Uber assigns a "support value" equal to the ceiling of the square root of its size. The goal is to compute the total support value across all groups. For example, given drivers_nodes = 10 , drivers_from = [1, 2, 3, 7] , and drivers_to = [2, 3, 4, 8] . This defines edges (1,2), (2,3), (3,4), (7,8). The connected components are: {1, 2, 3, 4} (size 4). Support value: ceil(sqrt(4)) = 2 . {7, 8} (size 2). Support value: ceil(sqrt(2)) = 2 . {5} (size 1). Support value: ceil(sqr