Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 3562. Maximum Profit from Trading Stocks with Discounts
Given a rooted company tree with buy/sell prices for each employee, pick a subset of nodes to buy (each at most once) under a total budget to maximize total profit, where a node’s buy cost is present[v] or floor(present[v]/2) if its direct boss is also bought. Core challenge: a knapsack-style optimization on a tree where item costs/benefits depend on parent selection (tree DP + budgeted knapsack).
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.