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

oceankumar/Leetcode-solutions

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

📊 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 65.6%
  • C++ 27.5%
  • Java 6.7%
  • C 0.2%