Review LeetCode problems without opening a browser. leetsheet is a fast, offline terminal app: search 1,158 problems, then read the strategy, a dry run, the edge cases, the complexity and two solutions side by side.
Filter as you type (left), then read the whole walkthrough in two panes (right).
A command-line application for developers who want a quick way to revise problems before an interview or a study session. Everything is read from a local database, so it needs no network.
Every one of the 1,158 problems comes with:
- Whiteboard explanation: the high-level strategy and the data structures involved.
- Dry run: a step-by-step example to make it stick.
- Test cases: the edge cases worth remembering.
- Complexity analysis: time and space, each with a justification.
- Two solutions: a hand-written, commented one and an AI-generated one, to compare.
And the app around them:
- Instant search. The list filters by title as you type.
- Tag filters. Type
#Array #HashTableto find problems by topic, across more than 500 tags. - Two-pane problem view. Details on the left, syntax-highlighted code on the right, with
cto swap between the manual and AI solution. - Vim-style keys and a responsive layout that adapts to your terminal size.
- Offline first. The whole database is compiled into the binary.
You need Go 1.25 or newer (see go.mod).
Install it with one command:
go install github.com/JonathanTSilva/leetsheet@latest
leetsheetgo install puts the binary in $(go env GOPATH)/bin, usually ~/go/bin, so make sure that directory is on your PATH. Or build it from a clone:
git clone https://github.com/JonathanTSilva/leetsheet.git
cd leetsheet
go build
./leetsheetThe binary carries the problem database with it, so you can run it from any directory. To put a built binary on your PATH:
sudo mv leetsheet /usr/local/bin/If a problems.json exists in the directory you run it from, leetsheet uses that file instead of the bundled one. That is how you keep your own set of problems.
Run leetsheet from your terminal. The application is fully keyboard-driven.
| View | Key | Action |
|---|---|---|
| Search | ctrl+c |
Quit the application |
| (Default) | / |
Start filtering (enter search mode) |
ctrl+j/k |
Navigate up/down the problem list | |
enter |
Select a problem and view its details | |
esc |
Clear the current filter/search | |
#tag |
Type # followed by a tag to filter |
|
| Problem | esc / / |
Go back to the search view |
| (Details) | tab |
Switch focus between left/right panes |
c |
Toggle between Manual and IA solution | |
↑/↓/j/k |
Scroll the content in the active pane |
All problem data is stored in problems.json. To add a problem, copy problems.json from this repository into the directory you run leetsheet from (or edit it in place if you run from the checkout), then append a JSON object with this structure to the array in that file:
{
"title": "Your Problem Title",
"link": "https://leetcode.com/problems/your-problem-name/",
"keywords": ["#Tag1", "#Tag2"],
"complexity": {
"time": {
"notation": "O(N)",
"justification": "Explanation for time complexity."
},
"space": {
"notation": "O(1)",
"justification": "Explanation for space complexity."
}
},
"whiteboard": "A high-level explanation of the approach.",
"dry_run": "A step-by-step walk-through with an example.",
"test_cases": "A list of important edge cases to consider.",
"ia_solution": "The AI-generated code solution string.",
"manual_solution": "The manually written and commented code solution string."
}JSON requires strings to be escaped (newlines as \n, quotes as \"). The code_to_json.py utility script does this for you:
- Optionally install
pyperclipto copy the output to your clipboard automatically:pip install pyperclip. - Open
code_to_json.pyand paste your multi-line code solution between the triple quotes. - Run
python code_to_json.py. - Paste the printed single-line string as the value of
ia_solutionormanual_solutioninproblems.json.
The repository layout and the engineering standard it follows are described in the handbook. Instructions for AI coding agents are in AGENTS.md.
- Go: the core language.
- Bubble Tea: the TUI framework.
- Lipgloss: terminal layouts.
- Glamour: Markdown and syntax-highlighted code rendering.
Thanks to the team at Charm for this suite of tools.
See the contributing guide. Branches are <type>/<issue>-<slug>, commits and PR titles follow Conventional Commits, and PRs are squash-merged.
Distributed under the MIT License. See LICENSE for more information.


