Need help with a test case, what am I missing? [[1,2,1],[2,1,3]] 2 2
Greetings,\n\nI want to understand this specific test case. The expected return value is 3, but from where I sit, I think it should be 4.\n\n\n[[1,2,1],[2,1,3]]
Greetings,\n\nI want to understand this specific test case. The expected return value is 3, but from where I sit, I think it should be 4.\n\n```\n[[1,2,1],[2,1,3]]\n2\n2\n```\n\nThis adj list describes a network of two nodes, 1 and 2. \n\n1 -> 2 at a delay of 1, and 2 -> 1 at a delay of 3. The signal input node is 2, and the signal output node is 2. \n\nHow long does it take a signal input at node 2 to reach node 2? The answer must be 0 or 4. From 2, you can travel to 1 at a cost of 3, but the signal is now at node 1 and has to return to node 2 with an additional delay of 1.  Or, you could take the case that when a signal is input to node 2, node 2 has the signal and no additional travel is required, so the answer is 0.\n\nWhat am I doing wrong here? How can one come up with a return value of 3?\n
[]