Company: Flipkart_20july
Difficulty: medium
Interdependent Component Failure Problem Description A system is made up of N components, some of which are interdependent. When a component fails, other components dependent on it also fail. However the dependent components can survive for some time after the original component fails, before they fail. These dependencies are shown as 'A B T' which means, A is dependent on B, but A can survive for T seconds after B fails. For a component X to work, all components on which it has dependency should work without fail. If a component X fails, any component that depends on X also stops working eventually. Not all the components are interdependent and no component depends on itself directly. However, an indirect dependency on itself is possible through other components. Given the dependencies of various components in the system, write a program to find the number of components that would fail if a particular component fails. Also find out how much time it takes for the last dependent compone