Available question text
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).
Related questions
Continue with questions that share topics or the same question type.
- Maximum Profit From Trading Stocks
Coding
- Maximum Profit from Valid Topological Order in DAG
Coding
- Find Maximum Removals From Source String
Coding
- Given an array nums and a sliding window of size k moving from the very left to the very right, return the maximum value in the window for each position. Solve in O(n) time using a deque.
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 3562. Maximum Profit from Trading Stocks with Discounts
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source