Home

Awesome

LeetCode

Solve LeetCode problems in VS Code

<p align="center"> <img src="https://raw.githubusercontent.com/LeetCode-OpenSource/vscode-leetcode/master/resources/LeetCode.png" alt=""> </p> <p align="center"> <a href="https://github.com/LeetCode-OpenSource/vscode-leetcode/actions?query=workflow%3ACI+branch%3Amaster"> <img src="https://img.shields.io/github/workflow/status/LeetCode-OpenSource/vscode-leetcode/CI/master?style=flat-square" alt=""> </a> <a href="https://gitter.im/vscode-leetcode/Lobby"> <img src="https://img.shields.io/gitter/room/LeetCode-OpenSource/vscode-leetcode.svg?style=flat-square" alt=""> </a> <a href="https://marketplace.visualstudio.com/items?itemName=LeetCode.vscode-leetcode"> <img src="https://img.shields.io/visual-studio-marketplace/d/LeetCode.vscode-leetcode.svg?style=flat-square" alt=""> </a> <a href="https://github.com/LeetCode-OpenSource/vscode-leetcode/blob/master/LICENSE"> <img src="https://img.shields.io/github/license/LeetCode-OpenSource/vscode-leetcode.svg?style=flat-square" alt=""> </a> </p>

❗️ Attention ❗️- Workaround to login to LeetCode endpoint

Note: If you are using leetcode.cn, you can just ignore this section.

Recently we observed that the extension cannot login to leetcode.com endpoint anymore. The root cause of this issue is that leetcode.com changed its login mechanism and so far there is no ideal way to fix that issue.

Thanks for @yihong0618 provided a workaround which can somehow mitigate this. Now you can simply click the Sign In button and then select Third Party login or Cookie login.

Note: If you want to use third-party login(Recommended), please make sure your account has been connected to the third-party. If you want to use Cookie login, click here to see the steps.

Requirements

Quick Start

demo

Features

Sign In/Out

<p align="center"> <img src="https://raw.githubusercontent.com/LeetCode-OpenSource/vscode-leetcode/master/docs/imgs/sign_in.png" alt="Sign in" /> </p>

Switch Endpoint

<p align="center"> <img src="https://raw.githubusercontent.com/LeetCode-OpenSource/vscode-leetcode/master/docs/imgs/endpoint.png" alt="Switch Endpoint" /> </p>

Pick a Problem

<p align="center"> <img src="https://raw.githubusercontent.com/LeetCode-OpenSource/vscode-leetcode/master/docs/imgs/pick_problem.png" alt="Pick a Problem" /> </p>

Editor Shortcuts

<p align="center"> <img src="https://raw.githubusercontent.com/LeetCode-OpenSource/vscode-leetcode/master/docs/imgs/shortcuts.png" alt="Editor Shortcuts" /> </p>

Search problems by Keywords

<p align="center"> <img src="https://raw.githubusercontent.com/LeetCode-OpenSource/vscode-leetcode/master/docs/imgs/search.png" alt="Search problems by Keywords" /> </p>

Manage Session

<p align="center"> <img src="https://raw.githubusercontent.com/LeetCode-OpenSource/vscode-leetcode/master/docs/imgs/session.png" alt="Manage Session" /> </p>

Settings

Setting NameDescriptionDefault Value
leetcode.hideSolvedSpecify to hide the solved problems or notfalse
leetcode.defaultLanguageSpecify the default language used to solve the problem. Supported languages are: bash, c, cpp, csharp, golang, java, javascript, kotlin, mysql, php, python,python3,ruby,rust, scala, swift, typescriptN/A
leetcode.useWslSpecify whether to use WSL or notfalse
leetcode.endpointSpecify the active endpoint. Supported endpoints are: leetcode, leetcode-cnleetcode
leetcode.workspaceFolderSpecify the path of the workspace folder to store the problem files.""
leetcode.filePathSpecify the relative path under the workspace and the file name to save the problem files. More details can be found here.
leetcode.enableStatusBarSpecify whether the LeetCode status bar will be shown or not.true
leetcode.editor.shortcutsSpecify the customized shortcuts in editors. Supported values are: submit, test, star, solution and description.["submit, test"]
leetcode.enableSideModeSpecify whether preview, solution and submission tab should be grouped into the second editor column when solving a problem.true
leetcode.nodePathSpecify the Node.js executable path. for example, C:\Program Files\nodejs\node.exenode
leetcode.showCommentDescriptionSpecify whether to include the problem description in the commentsfalse
leetcode.useEndpointTranslationUse endpoint's translation (if available)true
leetcode.colorizeProblemsAdd difficulty badge and colorize problems files in explorer treetrue
leetcode.problems.sortStrategySpecify sorting strategy for problems listNone
leetcode.allowReportDataAllow LeetCode to report anonymous usage data to improve the product. listtrue

Want Help?

When you meet any problem, you can check out the Troubleshooting and FAQ first.

If your problem still cannot be addressed, feel free to reach us in the Gitter Channel or file an issue.

Release Notes

Refer to CHANGELOG

Acknowledgement