logoalt Hacker News

Show HN: Openleetcode – local LeetCode runner where tests live in the repo

45 pointsby therepanictoday at 3:30 PM14 commentsview on HN

You write a standard solution, just like on LeetCode, and run it through the CLI. It identifies the problem by ID or title, executes your code against local test cases, and shows the result.

It currently supports around 1.4k problems and multiple languages, including Python, C++, Rust, Java, Go, TypeScript, Swift, and others.

The project is still an MVP. System design, SQL, and concurrency problems are not supported yet, but support for more problem types is planned.

Made in Haskell!


Comments

StableAlkynetoday at 9:01 PM

This is such a cool idea, I can't believe it hasn't been done before!

> It currently supports around 1.4k problems and multiple languages, including Python, C++, Rust, Java, Go, TypeScript, Swift, and others.

It would be interesting to have a variant where you get the input data through stdin or a file on disk, and verify by writing to stdout. That way you could bring your own language

joshribakofftoday at 6:19 PM

I just prompt my ai coding assistant directly to scaffold out problems and test cases.

One nice thing is the LLM can “reason” about my weak areas and tailor the drills it generates next to keep me on a productive path.

I personally don’t get much value from pulling in 1,400 arbitrary problems but this is cool for people who want to hit the ground running.

faxmeyourcodetoday at 7:15 PM

Nice! The idea of having a friday leetcode problem for my team has been kicked around to try and keep us on our toes when it comes to solving these style problems and preventing atrophy of this part of our brain. Might try wrapping this cli in some kind of web ui or adding it to our slackbot

seagramtoday at 6:34 PM

What a great idea for a project. Will try out. Any thoughts on supporting a CLI (or TUI) interface for browsing through the problem sets locally (titles, descriptions, difficulty, etc.)? On that note, open to contributions? And much respect for choosing Haskell.

show 1 reply
exabrialtoday at 7:53 PM

Why is leet code even a thing past 2024

show 2 replies
orsenthiltoday at 5:23 PM

Very cool. What motivated you to build this and what use case do you see for this project ?

show 1 reply
rfgplktoday at 4:46 PM

The fact that this is written in Haskell is amazing in it of itself. Will try it out

gaya3bollinenitoday at 6:19 PM

how do you keep the local test cases in sync when the original problems or test cases change?

show 1 reply
sam1rtoday at 5:46 PM

This is awesome!