A collection of 81 algorithm problems with Python solutions, originally from the ByteDance MarsCode Youth Training Camp. Each problem includes a detailed description, solution approach, complexity analysis, and tested implementation.
git clone https://github.com/ChanMeng666/juejin-algorithm-practice.git
cd juejin-algorithm-practice
# Run any solution
python problems/001-find-unique-number/solution.py
# Read the problem description
cat problems/001-find-unique-number/README.mdproblems/
001-find-unique-number/
README.md # Problem description, examples, and solution explanation
solution.py # Python solution with test cases
002-optimal-food-supply-strategy/
...
| Topic | Examples |
|---|---|
| Arrays & Strings | Majority element, string transformation, pattern matching |
| Dynamic Programming | Edit distance, stock trading, subarray optimization |
| Greedy Algorithms | Optimal refueling, food supply, menu selection |
| Math & Number Theory | Combination sum, percentile calculation, probability |
| Binary Search | Monster sequence, arena escape |
| Graph & Tree | Flight routes, virus propagation, tree traversal |
| Bit Manipulation | Find unique number, XOR operations |
| Sorting & Searching | Top-K elements, multi-criteria sorting |
| Simulation | Board games, card games, shooting scores |
| Encoding & Decoding | Base32, binary strings, RGB conversion |
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/improvement) - Commit your changes (
git commit -m 'Add improvement') - Push to the branch (
git push origin feature/improvement) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Chan Meng - GitHub