SIEMENS HEALTHINEERS Hiring | Off Campus OA (2025) | Question Maximum Total Importance of Roads
Question · Posted Jun 2026
Problem Statement You are given an integer n representing the number of cities numbered from 0 to n - 1 and a 2D array roads, where roads[i] = [u, v] indicates a bidirectional road between cities u and v. Assign each city a unique importance value from 1 to n such that: Every city receives a distinct value. The importance of a road is defined as: importance(u, v) = value[u] + value[v] The total importance of all roads is the ...
The full answer & interview discussion are available to premium members.
Log in Create a free account