How krishnasikarwar7/dsa-leetcode works
Project type and purpose
• This is neither a full-stack app nor a distributed service—it’s a monolithic repository of C++ solutions to LeetCode DSA problems.
• Purpose: serve as a personal archive and practice log. Each top-level folder is a standalone “module” containing a problem statement (README.md) and a final implementation (.cpp).
File structure
• Top-level directories: “1-two-sum”, “1013-fibonacci-number”, …, each named after a LeetCode problem ID and title.
• Inside each problem folder:
• README.md → problem description and metadata
• *.cpp → final C++ solution
• Root README.md describes the entire repo.
• No build scripts or CI configs are present (but can be added).
README for additional insights
• Languages used: C++ only.
• No reference to tests, build system, CI/CD, or deployment.
a. Main components
• Developer workstation (IDE, local compiler)
• Git repository (hosted on GitHub/GitLab)
• Build/CI pipeline (optional CI service)
• Problem modules (folders 1-two-sum, 1013-fibonacci-number, …)
• C++ compiler toolchain
• (Optional) Test harness or runner
b. Relationships & data flow
1. Developer edits .cpp and README.md locally.
2. Changes → commit → push to remote Git repo.
3. Git hook / CI triggers:
– Build step: compiler compiles each .cpp (all modules or target list).
– (Optional) Test runner validates outputs against known results.
4. CI logs/artifacts stored.
c. Architectural patterns & design principles
• Single Responsibility: each module folder encapsulates exactly one problem’s description + solution.
• Convention-over-configuration: folder naming scheme “<ID>-<title>” as automatic discovery of modules.
• Potential extension to a script-driven build system (e.g., CMake, Makefile) to auto-gather all .cpp.
d. Key technologies & libraries
• C++17 (or later) compiler (g++, clang++)
• Git (version control)
• Optional CI service (GitHub Actions, GitLab CI)
• (Optional) Test framework (Google Test, Catch2)
Detail
• Build discovery mechanism (wildcard .cpp detection or explicit list).
• Avoid over-splitting—each problem folder is atomic; don’t break it into smaller pieces. Instead, focus on the end-to-end flow: edit → commit → build → (optional) test.