Company: Rubrik_30oct
Difficulty: medium
Bangalore Road Issues Problem Description Three friends — Bipul, Nitro, and Arvind — are each waiting somewhere different across a sprawling, traffic-heavy city. The city is modeled as a graph: nodes numbered from 0 to n – 1 stand for locations, and directed edges stand for one-way roads, each carrying its own construction cost (weight). Bipul wants Nitro and Arvind to jointly pick a set of roads so that both of them are able to reach where he's waiting. Because road-building in this city is expensive and congested, the chosen set of roads should have the largest total construction cost possible among all sets that still work. This kind of question is often called "Least Cost Reachability." You are given: An integer n , the number of distinct locations in the city. An integer m , the number of distinct edges. A 2D integer array edges , where each entry [from, to, weight] denotes a one-way road running from from to to with construction cost weight . Three distinct integers giving the cu