Company: Flipkart_UI_IITB
Difficulty: medium
Component Dependency Problem Description A system is built from N components, and some of them rely on others. When a component goes down, every component that depends on it eventually goes down too — though a dependent component can keep running for a while after the one it relies on has already failed. Dependencies are written as "A B T", meaning A depends on B, and A can keep working for T seconds after B fails before A itself fails. A component X only keeps working as long as every component it depends on is also working. Once X fails, anything that depends on X eventually fails as well. Dependencies don't necessarily connect every pair of components, and no component depends directly on itself — though a chain of dependencies can loop back and create an indirect self-dependency. Given the full set of dependencies in the system, write a program that reports how many components end up failing when one particular component fails, and how long it takes for the last of those dependent