β οΈ DISCLAIMERThis is an educational tool provided for learning purposes only. The code and solutions in this repository are provided "AS IS" without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability arising from the use of this software.
This project is not affiliated with, endorsed by, or connected to LeetCode in any way.
- Web Interface: Flask-based solution browser with syntax highlighting
- Multi-Language Support: Upload and view solutions in 13+ programming languages
- **Python to LeetCode conversion **: Automatic conversion for LeetCode submission format
- Smart Downloads: Language-aware download system with skeleton/solution/ZIP options
- Quick Navigation: Dropdown menus on category cards for direct solution access
- API Support: JSON endpoints for dynamic content loading
- Organized Categories: Solutions grouped by problem-solving patterns
- Alternative Languages: Upload solutions in Java, C++, JavaScript, Go, Rust, etc.
- Language Switching: Toggle between different language implementations
- Format Options: View in original format or LeetCode submission format
- Download Formats:
- Skeleton (method signatures only)
- Full solution
- LeetCode formatted skelton and solution
- ZIP bundle with all formats
- Features
- Installation
- Usage
- Project Structure
- Features in Detail
- Development
- API Documentation
- Progress Tracking
- Contributing
- License
- Python 3.13+
- PDM package manager
# Clone the repository
git clone <repository-url>
cd leet_code
# Install dependencies with PDM
pdm install
# Run the development server
pdm run python -m flask run
- Navigate to
http://localhost:5000
- Browse categories or use quick access dropdowns
- Click on any solution to view code with syntax highlighting
- Open any solution page
- Click "Upload Solution"
- Select programming language
- Upload your solution file
- Language badge will appear for switching
- Individual Downloads: Click Skeleton/Solution/LeetCode buttons
- Language-Specific: Downloads match currently selected language
- ZIP Bundle: Download all formats for current language
- View LeetCode Format: Converts snake_case to camelCase
- Automatic Conversion: Ready for copy-paste to LeetCode
- Download LeetCode Format: Get submission-ready code
leet_code/
βββ README.md # This file
βββ pyproject.toml # PDM configuration
βββ pdm.lock # Lock file for dependencies
βββ app.py # Flask application
βββ category_data.py # Solution data management
βββ leetcode_converter.py # Snake_case to camelCase converter
βββ generate_docs.py # Documentation generator
β
βββ solutions/ # Problem solutions
β βββ arrays-hashing/ # Category folders
β β βββ 001-two-sum.py # Python solutions
β β βββ alternatives/ # Other language solutions
β β βββ 001-two-sum.java.java
β β βββ 001-two-sum.cpp.cpp
β βββ two-pointers/
β βββ sliding-window/
β βββ ...
β
βββ docs/ # Problem documentation
β βββ arrays-hashing/
β βββ ...
β
βββ templates/ # HTML templates
β βββ base.html
β βββ index.html
β βββ solution.html
β βββ upload_solution.html
β
βββ static/ # Static assets
βββ css/
β βββ style.css
βββ js/
Supported languages:
- Python (default)
- Java
- C++/C
- JavaScript/TypeScript
- Go
- Rust
- C#
- Swift
- Kotlin
- Ruby
- PHP
- Scala
Each download is language-aware:
- Python:
.py
files with optional LeetCode format - Other Languages: Native file extensions (.java, .cpp, etc.)
- ZIP Format: Contains skeleton, solution, and LeetCode skeleton and solution
- Python code is converted to LeetCode format.
- Shows first 10 solutions per category
- Direct navigation without intermediate pages
- "View all" link for categories with 10+ solutions
- Create solution file in appropriate category folder
- Follow naming convention:
{number}-{problem-name}.py
- Include problem description in docstring
- Run tests and linting before committing
GET /api/categories
Returns: JSON list of all categories with solution counts
GET /api/category/{category}/solutions
Returns: JSON list of solutions in category
GET /solution/{category}/{filename}
GET /solution/{category}/{filename}/leetcode
GET /solution/{category}/{filename}/view/{language}
GET /solution/{category}/{filename}/download/{format}
GET /solution/{category}/{filename}/download/{format}/{language}
Formats: skeleton, solution, leetcode, both
GET/POST /solution/{category}/{filename}/upload
Upload alternative language solution
- Total Solutions: 50+ problems across 15+ categories
- Languages Supported: 13 programming languages
- Categories: Arrays, Two Pointers, Trees, Graphs, DP, and more
- Fork the repository
- Create your feature branch
- Run tests and linting
- Submit a pull request
This project is for educational purposes.
A comprehensive LeetCode learning platform with multi-language support, automatic format conversion, and modern development tools.