Skip to content

kairoswong/leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode Explorer

Python JavaScript License Status

LeetCode solution browser with code viewer and approach notes.

Preview

Home Page Solution Detail Page

Home page and Solution detail page

Features

  • Problem Browser — filter by difficulty and tags
  • Code Viewer — Python solutions with one-click copy
  • Approach Notes — step-by-step reasoning with optimization tips
  • Problem Navigation — quick prev/next switching
  • Related Problems — knowledge graph connecting related topics
  • Agent Workflow — Agent skill (leetcode-sync) to auto-update metadata when adding new solutions

Quick Start

git clone https://github.com/kairoswong/leetcode.git
cd leetcode
# Open site/index.html directly (no server needed)

Optionally rebuild the data index:

python scripts/generate-index.py

Project Structure

leetcode/
├── skills/
│   └── leetcode-sync/
│       └── SKILL.md              # Agent skill
├── site/                         # Static site
│   ├── index.html                # Problem browser
│   ├── solution-detail.html      # Detail page (code + approach)
│   ├── data/                     # JSON data files
│   └── scripts/
├── solutions/                    # Python solution files
├── scripts/                      # Build & utility scripts
├── assets/
│   └── preview/                  # Screenshots for README
└── readme.md

Agent Workflow

An agent skill automates metadata updates when adding solutions.

Adding a New Solution

  1. Add a .py file in solutions/
  2. Run in any agent (Copilot, Claude Code, Codex):
    @leetcode-sync Add solution 15
    
  3. The agent reads your code, analyzes it to infer difficulty, complexity, tags, then updates all JSON data and rebuilds the site index.

Metadata Files Updated

File Content
site/data/difficulties.json Problem difficulty (easy / medium / hard)
site/data/complexities.json Time & space complexity
site/data/descriptions.json One-sentence problem description
site/data/approaches.json Solution approach / algorithm pattern
site/data/insights.json Key insight behind the solution
site/data/tags.json Topic tags for filtering

License

BSD 3-Clause License — see LICENSE.

About

Personal LeetCode solutions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors