MCPcopy Index your code
hub / github.com/Hsinha11/Leetcode-solutions

github.com/Hsinha11/Leetcode-solutions @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
1,337 symbols 1,759 edges 597 files 86 documented · 6% updated 2d ago★ 38
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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:
  2. Original problem statement
  3. Approach explanation
  4. Time/Space complexity analysis
  5. Example walkthrough

  6. Solution file - Named as {question-name}.py or {question-name}.cpp

  7. Clean, well-commented code
  8. 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!

Core symbols most depended-on inside this repo

get
called by 28
838-design-linked-list/design-linked-list.py
backtrack
called by 13
39-combination-sum/combination-sum.js
count
called by 12
-410-split-array-largest-sum/-410-split-array-largest-sum.cpp
moveZeroes
called by 10
283-move-zeroes/move-zeroes.py
remove
called by 10
381-insert-delete-getrandom-o1-duplicates-allowed/insert-delete-getrandom-o1-duplicates-allowed.py
dfs
called by 9
79-word-search/word-search.js
dfs
called by 9
417-pacific-atlantic-water-flow/pacific-atlantic-water-flow.js
dfs
called by 9
133-clone-graph/clone-graph.js

Shape

Method 685
Class 539
Function 113

Languages

Python62%
C++22%
Java11%
TypeScript4%
C1%

Modules by API surface

641-design-circular-deque/design-circular-deque.cpp10 symbols
2286-booking-concert-tickets-in-groups/2286-booking-concert-tickets-in-groups.cpp9 symbols
283-move-zeroes/move-zeroes.py8 symbols
MinimizeHammingDistance/MinimizeHammingDistance.cpp7 symbols
838-design-linked-list/design-linked-list.py7 symbols
427-Construct-Quad-Tree/427_Construct_quad_tree.py6 symbols
407_Trapping_Rain_Water_II/407.Trapping_Rain_Water_II.py6 symbols
3691-maximum-total-subarray-value-ii/3691-maximum-total-subarray-value-ii.cpp6 symbols
2719-count-of-integers/2719-count-of-integers.cpp6 symbols
2169-simple-bank-system/simple-bank-system.py6 symbols
1202-smallest-string-with-swaps/1202-smallest-string-with-swaps.cpp6 symbols
-1110-Delete Nodes and Return Forest/Delete Nodes and Return Forest.py6 symbols

For agents

$ claude mcp add Leetcode-solutions \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact