Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Solve LeetCode problems in VS Code

License

NotificationsYou must be signed in to change notification settings

arisosoftware/vscode-leetcode

 
 

Repository files navigation

Solve LeetCode problems in VS Code

Sponsor

coding

Requirements

  • VS Code 1.30.1+
  • Node.js 8+

    NOTE: Please make sure thatNode is in yourPATH environment variable. You can also use the settingleetcode.nodePath to specify the location of yourNode.js executable.

Quick Start

demo

Features

Sign In/Out

Sign in

  • Simply clickSign in to LeetCode in theLeetCode Explorer will let yousign in with your LeetCode account.

  • You can also use the following command to sign in/out:

    • LeetCode: Sign in
    • LeetCode: Sign out

Switch Endpoint

Switch Endpoint

  • By clicking the buttonbtn_endpoint at theexplorer's navigation bar, you can switch between different endpoints.

  • The supported endpoints are:

    • leetcode.com
    • leetcode-cn.com

    Note: The accounts of different endpoints arenot shared. Please make sure you are using the right endpoint. The extension will useleetcode.com by default.


Pick a Problem

Pick a Problem

  • Directly click on the problem or right click the problem in theLeetCode Explorer and selectPreview Problem to see the problem description.

  • SelectShow Problem to directly open the file with the problem description.

    Note: If no folder is opened in VS Code, the extension will save the problem files in$HOME/.leetcode/.

    You can specify whether including the problem description in comments or not by updating the settingleetcode.showCommentDescription.

    You can switch the default language by triggering the command:LeetCode: Switch Default Language.


Show Top Voted Solution

Show Top Voted Solution

  • SelectShow Top Voted Solution will display the top voted solution for you.

Submit the Answer

Submit the Answer

  • You can submit the answer by clickingSubmit at the bottom of the file. Or you can right click in the editor and selectSubmit to LeetCode.

If you want to hide the shortcuts showing in the editor, just simply set the settingleetcode.enableShortcuts to false.


Test the Answer

Test the Answer

  • You can test the answer by clickingTest at the bottom of the file. Or you can right click in the editor and selectTest in LeetCode.

  • There are 3 ways to test the answer:

    • Test with the default cases
    • Write test cases in input box
    • Test with the written cases in file

Search problems by Keywords

Search problems by Keywords

  • By clicking the buttonbtn_search at theexplorer's navigation bar, you can search the problems by keywords.

Manage Session

Manage Session

  • To manage your LeetCode sessions, just clicking theLeetCode: *** at the bottom of the status bar. You canswitch between sessions orcreate a new session.

Settings

Setting NameDescriptionDefault Value
leetcode.hideSolvedSpecify to hide the solved problems or notfalse
leetcode.showLockedSpecify to show the locked problems or not. Only Premium users could open the locked problemsfalse
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,swiftN/A
leetcode.useWslSpecify whether to use WSL or notfalse
leetcode.endpointSpecify the active endpoint. Supported endpoints are:leetcode,leetcode-cnleetcode
leetcode.outputFolderSpecify the relative path to save the problem files. Besides using customized path, there are also several reserved words which can be used here:
  • ${tag}: Categorize the problem according to their tags.
  • ${language}: Categorize the problem according to their language.
  • ${difficulty}: Categorize the problem according to their difficulty.
N/A
leetcode.enableStatusBarSpecify whether the LeetCode status bar will be shown or not.true
leetcode.enableShortcutsSpecify whether the submit and test shortcuts in editor or not.true
leetcode.enableSideModeSpecify whetherpreview,solution andsubmission tab should be grouped into the second editor column when solving a problem.true
leetcode.nodePathSpecify theNode.js executable path.node

Want Help?

When you meet any problem, you can check out theTroubleshooting andFAQ first.

If your problem still cannot be addressed, feel free to reach us in theGitter Channel orfile an issue.

Release Notes

Refer toCHANGELOG

Acknowledgement

About

Solve LeetCode problems in VS Code

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript100.0%

[8]ページ先頭

©2009-2025 Movatter.jp