gitmyhub

vscode-leetcode

TypeScript ★ 8.5k updated 1y ago

Solve LeetCode problems in VS Code

A VS Code extension that brings LeetCode coding challenges directly into your editor, letting you browse problems, write solutions, and submit them without leaving VS Code.

TypeScriptNode.jsVS Code APIsetup: easycomplexity 2/5

This is a Visual Studio Code extension that lets you browse, open, and solve LeetCode coding problems without leaving your code editor. LeetCode is a popular platform where developers practice algorithm and data structure problems, often to prepare for technical job interviews. This extension brings that experience directly into VS Code.

Once installed, a sidebar panel called the LeetCode Explorer appears. You can browse all LeetCode problems from there, filter by difficulty or topic, search by keyword, and click any problem to open it as a file in your editor. The problem description can appear in comments at the top of the file. When you are ready, two buttons appear in the editor to test your solution with custom inputs or submit it directly to LeetCode. The extension also shows the top-voted community solution for each problem if you want to compare.

The extension supports the international leetcode.com site and the Chinese leetcode.cn site. It works with a wide range of programming languages including Python, JavaScript, Java, C++, Go, Rust, and about a dozen more. You can switch your preferred language in settings. LeetCode sessions are also manageable from within the editor.

One notable issue the README mentions: logging into the international leetcode.com endpoint no longer works via the standard login flow, due to changes on LeetCode's side. The README provides a workaround using third-party account connections or cookie-based login. The Chinese endpoint does not have this problem.

Installation requires VS Code 1.30.1 or newer and Node.js version 10 or higher on your machine.

Where it fits