Problem 2374 · Medium

Node With Highest Edge Score

Each node adds its own index to the score of the node it points to; then the highest score wins, with ties going to the smaller index.

Open the interactive visualisation