All Projects → xavier-cai → vscode-leetcode-cpp-debug

xavier-cai / vscode-leetcode-cpp-debug

Licence: MIT License
Debug support for LeetCode with C++

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to vscode-leetcode-cpp-debug

Blender Debugger For Vscode
Blender addon for remote debugging Blender with VS Code (and Visual Studio)
Stars: ✭ 123 (+778.57%)
Mutual labels:  vscode, debug
Vscode Leetcode
Solve LeetCode problems in VS Code
Stars: ✭ 6,982 (+49771.43%)
Mutual labels:  leetcode, vscode
CVIP
C/C++/Golang/Linux...知识整理
Stars: ✭ 62 (+342.86%)
Mutual labels:  leetcode, debug
cattle
🐮 【W3Fun系列】图解数据结构与算法、LeetCode 题库(JS、C++、Python) 🏃 🏃 🏃
Stars: ✭ 26 (+85.71%)
Mutual labels:  leetcode
algorithm
《数据结构与算法之美》学习笔记以及 Swift 代码实现 ,原始仓库 https://github.com/wangzheng0822/algo
Stars: ✭ 118 (+742.86%)
Mutual labels:  leetcode
leetcode
A set of practice note, solution, complexity analysis and test bench to leetcode problem set
Stars: ✭ 31 (+121.43%)
Mutual labels:  leetcode
vscode-less
🔌 Less intellisense for Variables and Mixins in all Less files.
Stars: ✭ 21 (+50%)
Mutual labels:  vscode
Algorithms
✨ a bunch of algorithms in a bunch of languages ✨
Stars: ✭ 55 (+292.86%)
Mutual labels:  leetcode
objprint
A library that can print Python objects in human readable format
Stars: ✭ 141 (+907.14%)
Mutual labels:  debug
leetcode
👩‍🦲 LeetCode solutions (algorithms problems only) 👨‍🦲
Stars: ✭ 17 (+21.43%)
Mutual labels:  leetcode
leetcode
💭💡🎈 leetcode problem's solutions with C++, Rust and Python.
Stars: ✭ 31 (+121.43%)
Mutual labels:  leetcode
state inspector
State change & method call logger. A debugging tool for instance variables and method calls.
Stars: ✭ 24 (+71.43%)
Mutual labels:  debug
caddy-trace
Request Debugging Middleware Plugin for Caddy v2
Stars: ✭ 25 (+78.57%)
Mutual labels:  debug
algorithm coding
推荐算法、相似度算法、布隆过滤器、均值算法、一致性Hash、数据结构、leetcode练习
Stars: ✭ 30 (+114.29%)
Mutual labels:  leetcode
algorithm-study
草莓奶昔的算法学习笔记(typescript/python)
Stars: ✭ 29 (+107.14%)
Mutual labels:  leetcode
Debloat
Remove ads, bloatware and speed up your device.
Stars: ✭ 44 (+214.29%)
Mutual labels:  debug
LeetCode
leetcode图文题解
Stars: ✭ 36 (+157.14%)
Mutual labels:  leetcode
High-On-DSA
Repository with leetcode solutions and dedicated index to prepare for your FAANGM interviews. Feel free to share and contribute to this awesome repository.
Stars: ✭ 50 (+257.14%)
Mutual labels:  leetcode
kube-debug
一鍵調試kubernetes和docker容器的Web視覺化工具箱。A toolbox for debugging docker container and kubernetes with web UI.
Stars: ✭ 46 (+228.57%)
Mutual labels:  debug
ignition-tinker-tab
An Ignition tab to tinker with your Laravel app
Stars: ✭ 30 (+114.29%)
Mutual labels:  debug

LeetCode Debugger for C++

Debug support for LeetCode with C++ in VSCode

Quick Start

demo

Attention: Before start debugging, you must to check availability of your C++ debugger tools. Get more information from VSCode documents.

Features

Start Debugging

  • Generate debugging codes and start a debug session for your solution.

  • You can run the LeetCode Debugger: Start Debugging command from the command palette (Ctrl/Cmd + Shift + P).

Online/Offline Code Template

  • Code template is used to generate the debugging code.

  • Online: Fetching problem from LeetCode. Requires your solution file to start with problem ID, for example, 1.two-sum.cpp (Or you can modify the regular expression for capturing problem ID in extension settings).

  • Offline: Using your solution code as code template.

Input/Output

  • You could use the code below to change the input/output:

    #define INPUT "test_case.txt" // single-input
    #define OUTPUT cout, "output.txt" // multi-output
  • For INPUT, both std::istream and std::string (input from file) are acceptable, but you can only have ONE input.

  • For OUTPUT, both std::ostream and std::string (output to file) are acceptable, you can have multiple outputs.

Interactive Problem

  • Interactive problem is NOT supported yet.

  • But you can realize the interactive function by yourself! Know more from API and examples. Here is an example for problem 278.

    #ifdef LEETCODE_DEFINITION // protection
    int firstVersion; // the first bad version
    bool isBadVersion(int version) { // realization
        return version >= firstVersion;
    }
    #define LAZY_INTERACTION firstVersion // input firstVersion
    #endif
  • LAZY_INTERACTION means interactive inputs after function's arguments, INTERACTION means interactive inputs before function's arguments, in addition, function with type void () is also acceptable. The example below will help you to understand these stuff.

    #ifdef LEETCODE_DEFINITION // protection
    
    int value1, value2; // interactive values
    void before() {
        value1 *= 2;
    }
    void after() {
        value2 *= value1;
    }
    
    #define INTERACTION value1, before // input value1, then call the function 'before()'
    #define LAZY_INTERACTION value2, after // input value2, then call the function 'after()'
    
    #endif
    
    class Solution {
    public:
        int exampleFunction(int v) {
            return v * value1 * value2;
        }
    };
    
    /*
     * input:
     * 1 // -> value1 -> value1*=2 -> 2
     * 2 // -> v
     * 3 // -> value2 -> value2*=value1 -> 6
     * output:
     * 24 // -> v*value1*value2 -> 2*2*6=24
     * /

Extension Settings

Setting Name Description Default Value
Source Source of code template for generating debugging code. "[online]leetcode.com"
Delete Temporary Contents Delete temporary codes and files after debugging. true
Id Match Pattern Regular expression for capturing problem ID when fetching problem online. "(\\d+).*"
Output File Encoding Encoding of temporary code files "utf8"
  • The default value of Id Match Pattern can match any file name begin with a number.

Release Notes

Refer to CHANGELOG.

Tips

You can solve LeetCode problems in VSCode with another amazing extension LeetCode.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].