Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 791 Bytes

File metadata and controls

29 lines (22 loc) · 791 Bytes

LeetCode C++ Template Solution

A C++ template solution to manage multiple LeetCode answers simultaneously. No need to include any std headers and write the "std::" namespace prefix.

Example

#define SolutionID 0

// Start debugging, main0() will be excuted automatically.
void main0()
{
   vector<string> strings{ "Hello", "world", "."};
   for(auto& str : strings)
   {
      cout << str << " ";
   }
}

How it works

External linkage and macro designs. You can investigate them in LeetCodeTemplate.cpp.

IDE and Compiler

IDE: Visual Sudio 2022.

Compiler: MSVC or Clang. Choose the compiler at Properties>General>Platform Toolset. If you prefer Clang, you should install it in the VS Installer first.