A C++ project structure for organizing and running LeetCode problem solutions.
Here is my current leetcode profile: https://leetcode.com/u/victorsumpling/
LeetcodeNotes/
├── include/ # Header files
├── src/ # Source files for problems
├── build/ # Compiled binaries
├── docs/ # Documentation for problems
├── Makefile # Build system
├── template.cpp # Template for new problems
├── template.md # Template for documentation
└── new_problem.sh # Script to create new problems
./new_problem.sh ProblemName "Short description of the problem"This will:
- Create a new source file in
src/ProblemName.cpp - Create a documentation file in
docs/ProblemName.md
Edit the generated source file to implement your solution for the problem.
Edit the documentation file to describe your approach, time complexity, and any other notes.
make run PROBLEM_NAME=ProblemNamemake listThe project comes with a sample "TwoSum" problem implementation.
To run it:
make run PROBLEM_NAME=TwoSum