In a time-travel message relay system, messages are sent through a network of temporal nodes, each with a unique identifier and a list of connected nodes. The system administrator needs to determine the optimal route for a message to travel from a source node to a destination node, minimizing the total time dilation experienced during transmission. The time dilation at each node is calculated as the product of the node's identifier and the number of connected nodes. Given the network topology and the source and destination node identifiers, find the optimal route that minimizes the total time dilation. The network topology is represented as an adjacency list, where each key is a node identifier and its corresponding value is a list of connected node identifiers.
Analyze constraints and compute optimal solutions step-by-step.
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak