Member-only story
How to Code on LeetCode from the Terminal
Recently, I have been getting more and more into LeetCode because I am preparing to apply to various tech companies for summer internships.
However, while LeetCode offers a native editor for you to code the solution on, it was hard finding a working solution to be able to seamlessly code and submit from the terminal.
In this tutorial, I want to show you all how I managed to finally get a great working solution so you can use LeetCode from the terminal as well!
There are actually quite a few open-source projects that solve this exact problem, but many of them don’t work anymore (as of September 30th, 2021), since LeetCode recently changed the way their authentication worked. After hours of digging and trying out various of them, I finally found one that works really well and is still currently maintained (though I needed to go through a few extra steps to get it working).
Installation Guide
If you are on MacOS/Linux/Ubuntu, then the instructions below will work perfectly fine. However, if you are on Windows, I highly recommend you install WSL (Windows Subsystem for Linux), as it will make the installation process much simpler. I’ll link a guide here to installing WSL.