01 — 06
Submit
A push to your repository, or an attempt you paste in yourself.
POST /api/submissions
- slug
- two-sum-ii
- language
- cpp
- status
- accepted
- source
- github · commit 4e1f9c2
201 · { public_token: "9f3c…", status: "queued" }
DSA, but personal
Accepted is where most tools stop. LeafCode reads the approach you actually reached for, measures it against the one the problem rewards, and turns the distance between them into something you can watch happen.
Learn by watching the algorithm think, step by step.
Interactive algorithm visualizer
Two pointers · from both ends
Find a pair summing to 18
lo ← 0; hi ← n−1while lo < hi: if condition(a[lo], a[hi]) is met: record the answer move whichever end cannot improve the answerreturn best recordedStep 1 / 5 21 overshoots. 20 is the largest value left, so nothing can pair with it.
Each step discards one end for good, so no value is examined twice.
A judge answers one question: did it pass? LeafCode asks the one that changes how you solve the next problem. How did you get there?
01 — 06
A push to your repository, or an attempt you paste in yourself.
POST /api/submissions
201 · { public_token: "9f3c…", status: "queued" }
Two Sum · sorted input
Both of these are correct, and LeafCode says so. Watch one submission go through: written, classified, costed, and the gap it points at.
No table of working solutions exists. Lessons are pseudo code and prose, and a linter enforces that on every commit.
Not a curriculum you were assigned. The lesson exists because of something you submitted.
A trace is data, generated ahead of time. The same steps, in the same order, every time you watch.
When LeafCode cannot tell what approach you used, it says so plainly instead of guessing at one.