leetcode local debugging environment construction (C++ language)

Function

Just copy the test cases in leetcode to the local testcases.txt file, copy the Solution() class to the local main.cpp file, the main.cpp file can parse the input variables line by line, so as to realize the function of local debugging.

project path

demo

link

Instructions

  1. Copy the Solution class to main.cpp
  2. Copy test case data to testcase.txt
  3. Define class member parameters, call parse(cin, …) to parse variables
  4. By default, cmake is used to compile, and the c++ standard requires c++17 and above

principle

Most of the functions for processing input data come from leetcode. Currently, the following data types are supported, and these types are acceptable for most test cases.

  • int
  • string
  • vector<int>
  • vector<vector<int>>
  • vector<string>
  • ListNode*
  • TreeNode*

Guess you like

Origin blog.csdn.net/aiyolo/article/details/127114901