Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode solutions

Personal C++20 solutions to a small selection of algorithm exercises, with one GoogleTest executable per solution.

Solution Technique
Longest substring without repeating characters Sliding window
Median of two sorted arrays Merge and select
Longest palindromic substring Expand around each center
Zigzag conversion Row simulation
Reverse integer Checked decimal arithmetic

Build and test

Prerequisites are CMake 3.20+, a C++20 compiler, and GoogleTest 1.14 or a compatible packaged version. On Ubuntu, install g++, cmake, ninja-build, and libgtest-dev, then run:

cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build
ctest --test-dir build --output-on-failure

Alternatively, Conan can supply GoogleTest:

conan install . --output-folder=build --build=missing
cmake --preset conan-release
cmake --build --preset conan-release
ctest --preset conan-release

Each header intentionally retains LeetCode's global Solution class interface, so the test programs are separate executables. Tests cover all solutions and include deterministic generated cases, but they are not substitutes for the platform's full judge suite. Inputs are expected to meet each linked exercise's documented constraints, except where tests explicitly define behavior.

Attribution and license

The problem names, statements, examples, trademarks, and platform test data belong to their respective owners and are not licensed by this repository. No problem statements or proprietary judge data are included here. The original solution, test, and build code in this repository is available under the MIT License.

About

Tested C++20 solutions for selected LeetCode problems

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages