Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Create an array arr where arr[i] is the edge score for node i.
How does the edge score for node edges[i] change? It increases by i.
The edge score may not fit within a standard 32-bit integer.