A curated collection of LeetCode solutions organized by topic, featuring clean Python implementations with detailed explanations and complexity analysis.
This repository contains my solutions to various LeetCode problems, organized by algorithmic patterns and data structures. Each solution includes:
- Clean, well-commented Python code
- Problem description and approach
- Time and space complexity analysis
- Runtime and memory statistics from LeetCode
Note: This repository contains selected problems that I find particularly interesting or educational. For my complete LeetCode activity, check my LeetCode profile.
Solutions are organized into topic-based folders following the pattern Topic/ProblemName.py:
DSA/
├── Array/ # Array manipulation problems
├── Backtracking/ # Backtracking and recursion
├── Binary_Search/ # Binary search variants
├── Bit_Manipulation/ # Bitwise operations
├── Class/ # Object-oriented design problems
├── Dynamic_Programming/# DP optimization problems
├── Fenwick_Tree/ # Binary Indexed Tree
├── Graph/ # Graph algorithms (BFS, DFS, etc.)
├── Greedy/ # Greedy algorithms
├── Hash_Table/ # Hash-based solutions
├── Heap/ # Priority queue problems
├── Linked_Lists/ # Linked list operations
├── Math/ # Mathematical problems
├── Sliding_Window/ # Sliding window technique
├── Stack/ # Stack-based solutions
├── String/ # String manipulation
├── Tree/ # Binary tree problems
├── Trie/ # Prefix tree implementations
├── Two_Pointers/ # Two-pointer technique
├── Union_Find/ # Disjoint set union
└── LeetCode_Sync_Extension/ # Browser extension for auto-sync
The LeetCode Sync Extension is a Chrome/Edge browser extension that automatically syncs your accepted LeetCode submissions to this GitHub repository. When you successfully solve a problem on LeetCode, the extension:
- Detects your accepted submission automatically
- Fetches problem details and tags from LeetCode
- Generates an AI-powered explanation and complexity analysis using OpenAI or Google Gemini
- Organizes the solution into the appropriate topic folder
- Pushes the code and explanation to your GitHub repository
- Notifies you when the sync is complete
- Navigate to the
LeetCode_Sync_Extensionfolder in this repository - Open Chrome or Edge browser
- Go to
chrome://extensions(oredge://extensions) - Enable Developer Mode (toggle in top right corner)
- Click Load unpacked
- Select the
LeetCode_Sync_Extensionfolder
- Click the extension icon in your browser toolbar
- Configure the following settings:
- GitHub Personal Access Token: Create a token with
reposcope at GitHub Settings - Target Repository: Enter your repository name (e.g.,
fedeflowers/DSA) - LLM Provider: Choose between OpenAI or Google Gemini
- API Key: Enter your API key for the selected LLM provider
- GitHub Personal Access Token: Create a token with
- Click Save Settings
Once configured, the extension works automatically:
- Solve problems on LeetCode
- Submit your solution
- When you see the "Accepted" message, the extension automatically syncs
- Receive a browser notification confirming the sync
- Your solution appears in the appropriate folder in this repository
- Sync Failed: Check the browser console (right-click extension icon → Inspect) for error details
- No Notification: Ensure browser notifications are enabled
- Wrong Folder: The extension uses LeetCode's primary tag to determine the folder
- Language: Python 3.x
- Extension: JavaScript (Manifest V3)
- AI Integration: OpenAI GPT / Google Gemini
- Version Control: Git & GitHub
Check my LeetCode profile for my current stats and progress.
This project is licensed under the MIT License - see the LICENSE file for details.