LeetCode Problem Buddy (LCPB) VS Code Extension
Welcome to the documentation for LeetCode Problem Buddy (LCPB), a VS Code extension designed to simplify the process of testing LeetCode problems on your local machine. This extension allows you to fetch LeetCode problems (using the leetcode-query API), test them against the provided test cases or custom test cases, and even add test cases from local text files.
All of this is accomplished without the need to manually write driver code, as the driver code is automatically generated based on the problem being worked on. While this approach significantly streamlines development, the complexity of LeetCode's diverse problem set and tight development timeline present challenges in comprehensively addressing all edge cases. Specifically, problems involving pointer data types (with the exception of consistently handled TreeNode
) may necessitate manual driver code implementation, particularly due to the varied definitions of custom types like Node
or ListNode
.
Key Assumptions
To ensure a smooth experience, the following assumptions were made for input formats:
Single-Dimensional Arrays or Lists
- For parameters of type
vector<>
or List[]
, the input must be provided in a single line, with no newline characters.
- Elements should be separated by spaces and enclosed within square brackets (
[]
).
Multi-Dimensional Arrays or Nested Lists
- For parameters of type
vector<vector<>>
or List[List[]]
, follow the same single-line format for each inner vector or list.
- The parent vector or list must be enclosed in an additional pair of square brackets (
[]
).
Binary Trees (TreeNode
)
- For parameters of type
TreeNode*
(C++), TreeNode
, or Optional[TreeNode]
(Python), use the same input format as for vector<>
or List[]
.
Supported Languages
Features
- Automatic Driver Code Generation
- Eliminates the need to manually write boilerplate code for test cases.
- Run Code Against Test Cases
- Supports both example test cases and user-defined test cases.
- Detailed Test Case Output
- Displays expected and received outputs for each test case.
- Error Handling
- Provides clear error messages when test cases fail.
- File-Based Test Cases
- Allows fetching and running test cases directly from local text files.
- Custom Configuration Options
- Configure paths, settings, and compilation commands for each supported language.
- Save Test Cases
- Test cases can be saved to files based on user preferences in the settings.
- Fetch Template Code
- Retrieve template files for supported languages directly from user-specified locations, ensuring a personalized and seamless coding experience.
Demo
Watch the Demo Video Here
Extension Settings
The following settings can be configured to customize your experience:
Release Notes
Version 1.0.0
Initial release of LeetCode Problem Buddy, bringing automated driver code generation, custom test case support, and seamless integration for LeetCode problem solving.
License
This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License. See the LICENSE file for details.