Search
⌘K

Leetcode 2374. Node With Highest Edge Score

Given a directed functional graph (each node has exactly one outgoing edge via edges[i]), compute each node's "edge score" as the sum of labels of nodes that point to it and return the node with the highest score, breaking ties by smallest index. Constraint: n up to 1e5.

Asked at:

Amazon

Amazon


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Mid November, 2024

Amazon

Amazon

Junior

Directed Graph Edge Score: Find the node with the highest edge score in a directed graph. If there's a tie, return the smallest indexed node.

Comments

Your account is free and you can post anonymously if you choose.