Company: Flipkart_20july
Difficulty: medium
Interdependent Component Failure Problem Description A system consists of N components, and some of them depend on one another. When a component fails, the components relying on it eventually fail too, but a dependent component can keep running for a while after the one it relies on has gone down. Such a relationship is written as 'A B T', meaning A depends on B, and A can keep operating for T seconds after B fails before A itself fails. A component X only stays operational as long as every component it depends on is also operational. Once a component fails, anything that depends on it eventually fails as well. Not every pair of components is linked this way, and no component depends directly on itself, though a chain of dependencies can loop back to a component indirectly. Given the dependency relationships across the system, write a program that reports how many components would go down if one particular component fails, along with how long it takes for the last of the dependent comp