Skip to content

Contributing

nvas222 edited this page Oct 8, 2025 · 1 revision

Contributing to LeetcodeGit

Thank you for your interest in contributing to this repository of LeetCode solutions! This document provides guidelines and instructions for contributing.

Ways to Contribute

  1. Add new solutions: Implement solutions for problems not yet covered
  2. Improve existing solutions: Optimize for better time/space complexity
  3. Add test cases: Expand test coverage for edge cases
  4. Improve documentation: Add explanations, diagrams, or better comments
  5. Fix bugs: Address any issues in existing solutions
  6. Create tutorials: Help with learning materials and guides

Contribution Process

For Adding New Solutions

  1. Check if the problem is already solved:

    • Browse the repository to ensure the problem isn't already implemented
    • Check open pull requests to avoid duplicate work
  2. Fork and clone the repository:

    git clone https://github.com/nvas222/LeetcodeGit.git
    cd LeetcodeGit
  3. Create a branch:

    git checkout -b solution/problem-name
  4. Implement your solution:

    • Place the solution in the appropriate difficulty folder
    • Follow the existing code structure and naming conventions
    • Implement using the ISolution interface
    • Add XML documentation comments
  5. Add unit tests:

    • Create comprehensive tests in the Tests project
    • Include edge cases and performance benchmarks when appropriate
  6. Run tests locally:

    dotnet test
  7. Commit and push:

    git add .
    git commit -m "Add solution for Problem #X: Problem Name"
    git push origin solution/problem-name
  8. Create a pull request:

    • Go to the GitHub repository
    • Click on "Pull Requests" and "New Pull Request"
    • Choose your branch and submit

Solution Requirements

All solutions should:

  • Implement the ISolution interface
  • Include proper XML comments
  • Have comprehensive unit tests
  • Specify time and space complexity
  • Follow C# coding conventions
  • Be well-commented to explain the approach

Style Guidelines

C# Coding Style

  • Use camelCase for private fields and parameters
  • Use PascalCase for class names, methods, and properties
  • Use meaningful variable names
  • Add XML comments for all public methods and classes
  • Follow the Microsoft C# Coding Conventions

Git Commit Messages

  • Use clear and descriptive commit messages
  • Begin with an action verb (Add, Fix, Update, Refactor, etc.)
  • Reference the problem number and name when applicable
  • Example: "Add solution for Problem #42: Trapping Rain Water"

Code Review Process

Pull requests will be reviewed for:

  • Correctness of the solution
  • Code quality and style
  • Test coverage
  • Documentation quality
  • Performance considerations

Resources for Contributors

Recognition

All contributors will be acknowledged in the repository's README or a dedicated CONTRIBUTORS file.


Thank you for contributing to the learning community! Your contributions help others learn and improve their algorithmic problem-solving skills.

If you have any questions, please open an issue or contact the repository maintainer.

Clone this wiki locally