Skip to content

CPH LeetCode is a VSCode extension designed to streamline the competitive programming workflow. It automates the extraction of test cases from LeetCode problems and saves them locally for offline testing. With real-time progress updates, users can efficiently generate input and output files for problem-solving and debugging.

License

Notifications You must be signed in to change notification settings

akash-singh112/cph-leetcode

Repository files navigation

CPH Leetcode Extension for VS Code

CPH Leetcode is a Visual Studio Code extension designed to streamline competitive programming workflows by integrating Leetcode functionalities directly into the editor. Solve problems, fetch test cases, and run solutions—all without leaving VS Code!


Features

  • Works with LeetCode
  • Fetch sample test cases for problems and store them locally.
  • Run solutions against fetched test cases directly in VS Code with real-time results.
  • Access features through the CPH Leetcode UI in the VS Code activity bar.
  • Shows discrepancies if actual output does not match expected output.

Screenshots

Custom UI in Activity Bar

Custom UI

Demo Video


Installation

  1. Open Visual Studio Code.
  2. Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window.
  3. Search for Competitive Programming Helper: Leetcode (cph-lc).
  4. Click Install to install the extension.

Alternatively, you can install directly from the Visual Studio Marketplace.


How to Use

  1. After installation, navigate to the CPH Leetcode view in the activity bar.
  2. Use the following commands from the Command Palette:
    • CPH: Fetch Test Cases: Fetch sample test cases for a problem.
    • CPH: Run Test Cases: Execute your code against the fetched test cases.

Alternatively, you can interact with the UI in the activity bar and perform the same actions.


Supported Languages

  • C++
  • Python3

Upcoming Major Updates

  • Support for Java
  • Feature for user to extract test cases for Leetcode daily challenge from extension itself
  • Allow users to change default storage folder for test cases (which is currently "TestData" in same working directory)

Project Structure

  • icons: Contains the logo and icons for the extension.
  • helper-functions/: Includes utility functions for test case fetching, test case execution, and to fetch HTML for the UI of Extension.
  • extension.js: Main Logic for the extension goes here.
  • final.py: Python script to fetch sample test cases from desired URL.

Contributing

Contributions are welcome! To contribute:

  1. Fork this repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Commit your changes (git commit -am 'Add a new feature').
  4. Push to the branch (git push origin feature-branch).
  5. Create a new Pull Request.

License

This project is licensed under the MIT License. See the LICENSE file for details.


Author

Made with ❤️ by Akash. If you find this extension helpful, please give it a ⭐ on GitHub.

Also, if you encounter any issues, or have any questions, feel free to contact me at akashsingh242678@gmail.com

About

CPH LeetCode is a VSCode extension designed to streamline the competitive programming workflow. It automates the extraction of test cases from LeetCode problems and saves them locally for offline testing. With real-time progress updates, users can efficiently generate input and output files for problem-solving and debugging.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published