Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>CPHNew to Visual Studio Code? Get it now.
CPH

CPH

Aditya Kumar

|
2,613 installs
| (0) | Free
It is very useful for competitive programmers who want to run the problem's testcases before directly checking it on the coding platform
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Competitive Programming Helper (CPH)

Overview

The Competitive Programming Helper (CPH) extension allows users to fetch LeetCode problem inputs and outputs directly from the command palette and verify their solutions against the fetched test cases.

Features

  1. Fetch Test Cases: Use the CPH:Fetch Test Cases command to fetch inputs and outputs for any LeetCode problem.
  2. Run Test Cases: Use the CPH:Run Test Cases command to check if your solution produces the correct output for the fetched inputs.

Usage

Fetching Test Cases

  1. Open the command palette (Ctrl+Shift+P or Cmd+Shift+P).
  2. Run the command CPH:Fetch Test Cases.
  3. Enter the LeetCode problem slug (e.g., "two-sum").
  4. The inputs and outputs will be saved to input.txt and output.txt respectively in your workspace folder.

Running Test Cases

  1. Ensure your solution outputs results in the same format as output.txt.
  2. Open the command palette (Ctrl+Shift+P or Cmd+Shift+P).
  3. Run the command CPH:Run Test Cases.
  4. A test_output.txt file will be created with your solution's output.
  5. The extension will compare output.txt and test_output.txt:
    • If they match, you will see a message: Test cases passed successfully!
    • If they do not match, you will see a message: Test cases not passed successfully!

Adding More Test Cases

You can add more test cases by writing specific inputs and expected outputs in input.txt and output.txt. Run the CPH:Run Test Cases command to verify if your code produces the correct output.

Notes

  • Ensure your solution's output format matches the format in output.txt.
  • The extension supports only two programming languages which includes Python and C++.

Happy coding!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft