This repository is intended to document the LeetCode questions on algorithms and data structures in modern C++.
- Download Visual Studio Code
- Install Docker
- Open the project in the root folder with VSCode.
- Click on the left down corner symbol "><"
- Then click on reopen in container (This will take care of building the Docker container)
- Note for using this withing PowerShell one needs to disable
git config --global core.autocrlf input
Error while running Docker code in PowerShell - In order to use git without dubious ownership inside the container add the following line to the devcontainer.json
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
reference, Avoiding Dubious Ownership in Dev Containers
-
Create a directory with the number of the problem and the name, remove special characters replace spaces with "_" eg: 13. Roman to Integer resolves in 13_Roman_to_Integer
-
When submitting a problem a create the cpp file in a way that you just need to copy the class for submitting eg:
class Solution { public: void leetCodeFunction() { // Code goes here; } }