Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1468. Calculate Salaries
Given a directed management graph (often as an adjacency matrix) where an employee with no subordinates has salary 1 and every other employee's salary equals the sum of their direct subordinates' salaries, compute each employee's salary and return the total. This is a DAG dynamic-programming problem best solved via DFS with memoization or topological DP to aggregate subtree sums.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.