How apurva313/leetcode-problem-solution works
Project type and purpose
• This is an open-source repository of Java solutions to individual LeetCode algorithm problems. It is not a client-server system or service, but rather a library of standalone problem modules combined with a simple build process.
File structure
• Top-level:
• A directory per LeetCode problem, named with its problem number and title (e.g., “Q14. Longest Common Prefix”).
• Inside each problem directory: one or more Java source files (e.g., Solution.java or MinStack.java).
• A README.md at the root describing project goals, setup, contribution guidelines, and license.
• Build artifacts: no dedicated “bin” or “build” folder in the tree, but the README instructs users to compile into a “bin” directory.
README for additional insights
• Confirms the project’s goal is to collect clear, commented Java solutions.
a. Main components
• Problem Modules – each folder is a self-contained module with one or more Java classes.
• Build System – the javac compiler and output “bin” directory.
• Developer Interface – IDE (e.g., VS Code) or CLI for browsing, editing, compiling, and running.
• Repository & Collaboration – GitHub with branches, pull requests, and issue tracking.
b. Relationships and interactions
• Developer checks out code from GitHub → edits or adds a Problem Module → runs build script → javac compiles all .java files into /bin → developer runs .class via CLI or IDE.
• Contributor submits PR to GitHub → CI (optional) runs compilation check → merges back to main branch.
c. Important architectural patterns or design principles
• Modularity: each LeetCode problem is fully isolated in its own directory, enforcing single-responsibility.
• Convention-over-configuration: uniform naming and layout reduces cognitive load.
• Extensibility: adding a new problem is as simple as creating a new directory with a .java solution.
d. Key technologies and frameworks
• Java SE (javac / java)
• Git & GitHub for version control and collaboration
• (Optional) a CI pipeline: GitHub Actions or similar to automate “javac” checks on pull requests