Skip to content

Carefully organized LeetCode problem solutions with detailed explanations and code, structured by problem number and name, supporting multiple languages. Ideal for improving coding skills and open-source collaboration.

Notifications You must be signed in to change notification settings

ManaswibRane/Leetcode-solutions

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Banner

LeetCode Solutions ๐Ÿ“Š

LeetCode Python Hacktoberfest

Welcome to my LeetCode solutions repository! This is a comprehensive collection showcasing problem-solving journey across various topics and difficulty levels. This repository is open for Hacktoberfest 2025 contributions! ๐ŸŽ‰


๐ŸŒŸ Repository Highlights

  • Diverse Topics:
    Solutions covering various areas:

    • ๐Ÿฅ‡ Arrays
    • ๐Ÿงฉ Strings
    • ๐ŸŒณ Trees
    • ๐ŸŒ Graphs
    • โš™๏ธ Dynamic Programming
    • ๐Ÿงฎ Mathematics
    • ๐Ÿ› ๏ธ Bit Manipulation
  • Difficulty Levels:
    Problems categorized into:

    • ๐ŸŸข Easy
    • ๐ŸŸก Medium
    • ๐Ÿ”ด Hard
  • Learning Journey:
    Each solution includes:

    • ๐Ÿง  Thought processes and approach
    • ๐Ÿ” Algorithms and data structures used
    • โฑ๏ธ Time and space complexity analysis
    • ๐Ÿ“š Key insights and takeaways

๐Ÿ“ Folder Structure

IMPORTANT: This repository follows a specific structure. Please adhere to it when contributing:

/LeetCode-Solutions
  โ”œโ”€โ”€ 1-two-sum/
  โ”‚   โ”œโ”€โ”€ README.md           # Problem description and explanation
  โ”‚   โ””โ”€โ”€ two-sum.py          # Solution code
  โ”œโ”€โ”€ 2-add-two-numbers/
  โ”‚   โ”œโ”€โ”€ README.md           # Problem description and explanation  
  โ”‚   โ””โ”€โ”€ add-two-numbers.cpp # Solution code
  โ”œโ”€โ”€ 15-3sum/
  โ”‚   โ”œโ”€โ”€ README.md           # Problem description and explanation
  โ”‚   โ””โ”€โ”€ 3sum.py             # Solution code
  โ””โ”€โ”€ README.md               # This file

Folder Naming Convention:

  • Format: {question-number}-{question-name}/
  • Use lowercase with hyphens for question names
  • Examples: 1-two-sum/, 121-valid-palindrome/, 200-number-of-islands/

File Structure Inside Each Folder:

  1. README.md - Contains:

    • Original problem statement
    • Approach explanation
    • Time/Space complexity analysis
    • Example walkthrough
  2. Solution file - Named as {question-name}.py or {question-name}.cpp

    • Clean, well-commented code
    • Optimized solution preferred

๐ŸŽ‰ Hacktoberfest 2025 - Open Source Contributions Welcome! ๐ŸŽ‰

This repository is participating in Hacktoberfest 2025! We welcome contributors of all skill levels to help grow this comprehensive collection of LeetCode solutions.

๐Ÿ“‹ How to Contribute

Step 1: Prerequisites

  • โญ Star this repository before making any contributions
  • ๐Ÿด Fork this repository to your GitHub account
  • ๐Ÿ“‹ Register for Hacktoberfest 2025 at hacktoberfest.com

Step 2: Setting Up

# Clone your forked repository
git clone https://github.com/YOUR-USERNAME/leetcode-solution.git
cd leetcode-solution

# Create a new branch for your contribution
git checkout -b solution/problem-name

Step 3: Adding Your Solution

  1. Create a folder following the naming convention: {number}-{problem-name}/
  2. Add README.md with problem description and your approach
  3. Add solution file: {problem-name}.py or {problem-name}.cpp
  4. Ensure your code is well-commented and follows best practices

Step 4: Submit Your Contribution

# Add your changes
git add .

# Commit with a meaningful message
git commit -m "Add solution for Problem #123: Problem Name"

# Push to your fork
git push origin solution/problem-name

๐Ÿšจ Contribution Guidelines - READ CAREFULLY

โœ… What We Accept:

  • New LeetCode solutions not already present in the repository
  • Optimized versions of existing solutions with better time/space complexity
  • Solutions in different languages (Python, C++, Java, JavaScript)
  • Improved documentation and problem explanations
  • Bug fixes in existing solutions

โŒ What We DON'T Accept:

  • Duplicate solutions (check existing folders first!)
  • Solutions without proper folder structure
  • Code without comments or explanations
  • Spam or low-effort contributions
  • Solutions that don't work or haven't been tested

๐Ÿ“ Quality Standards:

  • Test Your Code: Ensure your solution passes on LeetCode before submitting
  • Follow Structure: Adhere to the exact folder and file naming conventions
  • Add Documentation: Include README.md with problem statement and approach
  • Clean Code: Write readable, well-commented code
  • One Problem Per PR: Submit separate pull requests for each problem

๐Ÿ” Before Contributing:

  1. Check for duplicates: Search existing folders to avoid duplicate submissions
  2. Read the problem: Understand the LeetCode problem thoroughly
  3. Test locally: Verify your solution works with the given examples
  4. Follow templates: Use the structure shown in existing solutions

๐Ÿท๏ธ Pull Request Template

When creating your PR, please include:

  • Problem number and name
  • Approach used (e.g., Two Pointers, Dynamic Programming)
  • Time and Space complexity
  • Any additional notes or optimizations

๐ŸŽฏ Good First Issues

New to open source? Look for these types of contributions:

  • Easy-level LeetCode problems
  • Adding missing solutions in popular languages
  • Improving documentation in existing solutions
  • Adding complexity analysis to solutions

๐Ÿšซ Anti-Spam Policy

  • PRs that don't follow the guidelines will be marked as invalid
  • Spam PRs will be labeled as spam and closed immediately
  • Quality over quantity - focus on meaningful contributions

๐Ÿ† Recognition

All contributors will be acknowledged in our contributors section. Top contributors may be featured in repository highlights!


๐Ÿค Code of Conduct

By participating in this project, you agree to maintain a respectful and inclusive environment. Be kind, helpful, and constructive in all interactions.


๐Ÿ“ž Need Help?

  • ๐Ÿ› Found a bug? Open an issue with details
  • โ“ Have questions? Check existing issues or create a new one
  • ๐Ÿ’ก Suggestions? We'd love to hear your ideas!
  • ๐Ÿ˜ข PR not approved? I tend to approve most PRs at night, in case your PR doesn't get approved timely tag me @Hsinha11 in the comments and I shall approve it, if it is fit :)

๐Ÿ“Š Repository Stats

Contributors Issues Pull Requests Stars


Happy Coding! Let's make this Hacktoberfest amazing together! ๐Ÿš€

Remember: The goal is to learn, contribute, and grow together as a community. Every contribution, no matter how small, makes a difference!

About

Carefully organized LeetCode problem solutions with detailed explanations and code, structured by problem number and name, supporting multiple languages. Ideal for improving coding skills and open-source collaboration.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 48.2%
  • C++ 29.6%
  • Java 14.5%
  • JavaScript 7.6%
  • C 0.1%