LeetSolv is a CLI tool for Data Structures and Algorithms (DSA) problem revision with spaced repetition. It supports problems from LeetCode and HackerRank. Powered by a customized SuperMemo 2 algorithm that incorporates familiarity, importance, and reasoning to move beyond rote memorization.
scoop bucket add extras
scoop install extras/leetsolvbrew install leetsolvcurl -fsSL https://raw.githubusercontent.com/eannchen/leetsolv/main/install.sh | bashTo uninstall:
curl -fsSL https://raw.githubusercontent.com/eannchen/leetsolv/main/install.sh | bash -s -- --uninstallLeetSolv can be run interactively or by passing commands directly from your terminal.
# Start interactive mode
leetsolv
# Or run commands directly
leetsolv add https://leetcode.com/problems/two-sum
leetsolv status
# Get help
leetsolv helpView Full Usage Guide (USAGE.md)
Unlike standard SM-2 (used by Anki), LeetSolv adds importance and reasoning factors—designed for DSA practice, not flashcard memorization. Familiarity (5 levels), Importance (4 levels), and Reasoning (3 levels) determine your next review date. Randomization prevents bunching reviews on the same days.
graph TD
A[Add a DSA Problem to LeetSolv] --> B[Algorithm Applies Adaptations]
B --> C[Familiarity Scale]
B --> D[Importance Scale]
B --> E[Reasoning Scale]
B --> F[Due Penalty, optional]
B --> G[Randomization, optional]
H[Algorithm Calculates with SM-2 Ease Factor]
C --> H
D --> H
E --> H
F --> H
G --> H
H --> I[Determine Next Review]
Due reviews can accumulate over time. LeetSolv ranks them by priority score so you can focus on what matters most.
Default formula: (1.5×Importance) + (0.5×Overdue Days) + (3.0×Familiarity) + (-1.5×Review Count) + (-1.0×Ease Factor)
Review intervals expand based on importance, familiarity, and reasoning. Higher importance = shorter intervals, more frequent reviews.
- CRUD + Undo: Create, view, update, delete problems. Undo your last action.
- Trie-Based Search: Fast filtering by keyword, importance, familiarity.
- Quick Views: Summary of due/upcoming problems with paginated listing.
- Interactive & Batch Modes: Run interactively or pass commands directly.
- Intuitive Commands: Familiar aliases (
ls,rm), color-coded output.
- No Data Collection: LeetSolv does not upload user data to the internet.
- Atomic Writes: All writes use temp file + rename for data consistency.
Customize via environment variables or JSON config. See CONFIGURATION.md for all options.
A: Anki is great for memorizing facts, but DSA requires deeper practice. LeetSolv's SM-2 algorithm uses reasoning, familiarity, and importance to schedule deliberate problem-solving—not rote recall.
A: No. Only add problems you want to revisit. The algorithm uses the add date for scheduling—bulk-adding creates unrealistic schedules. For old problems, re-solve first, then add.
A: SM-2 accumulates dues if you skip days. Use Due Priority Scoring to focus on high-priority problems first. Remove mastered problems—the goal is active practice, not tracking everything.
A: LeetSolv is implemented in pure Go for full control over all implementations—no external libraries. See MOTIVATION.md for the design philosophy.
Open an issue for questions or suggestions.
LeetSolv - A spaced repetition CLI for DSA, powered by a custom SM-2 algorithm for deliberate practice.





