Skip to content

Conversation

@yanglbme
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings December 11, 2025 14:49
@idoocs idoocs added cpp Issues or Pull requests relate to .cpp code go Issues or Pull requests relate to .go code core team Issues or pull requests from core team java Issues or Pull requests relate to .java code md Issues or Pull requests relate to .md files py Issues or Pull requests relate to .py code ts Issues or Pull requests relate to .ts code labels Dec 11, 2025
@yanglbme yanglbme merged commit 60c4ca0 into main Dec 11, 2025
20 of 21 checks passed
@yanglbme yanglbme deleted the dev branch December 11, 2025 14:51
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds solutions to LeetCode problem 3562 "Maximum Profit from Trading Stocks with Discounts" from Weekly Contest 451. The problem involves maximizing stock trading profits in a company hierarchy where employees can get discounts if their direct boss purchases stock.

Key changes:

  • Implements tree-based dynamic programming solutions across five programming languages
  • Adds comprehensive problem documentation in both Chinese and English
  • Includes visual examples and constraints for the problem

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Solution.py Python implementation using DFS with 2D DP state tracking budget and parent purchase status
Solution.java Java implementation with class-level state management for graph and arrays
Solution.cpp C++ implementation using lambda with recursive capture for DFS
Solution.go Go implementation with closures for DFS traversal
Solution.ts TypeScript implementation with proper Math.floor for integer division
README.md Chinese problem description with examples, constraints, and inline solution code
README_EN.md English problem description with examples, constraints, and inline solution code
CONTEST_README.md Updated contest index to include reference to problem 3562
CONTEST_README_EN.md Updated English contest index to include reference to problem 3562
README.md (solution/) Updated main problem index with problem 3562 metadata
README_EN.md (solution/) Updated English main problem index with problem 3562 metadata

The solutions correctly implement a tree DP algorithm where each node maintains state for different budget levels and parent purchase decisions. All language implementations are consistent and handle the discount policy correctly (half price when parent buys). No issues were identified in the code logic, naming conventions, or documentation.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core team Issues or pull requests from core team cpp Issues or Pull requests relate to .cpp code go Issues or Pull requests relate to .go code java Issues or Pull requests relate to .java code md Issues or Pull requests relate to .md files py Issues or Pull requests relate to .py code ts Issues or Pull requests relate to .ts code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants