Solutions to problems from Daily Coding Problem, mostly in C++1.
Three years ago in 2019, during my sophomore year in college, I first subscribed to Daily Coding Problem to get some interview practice. Now that I am a "working adult", I have decided to rework some of these problems just to refresh my brain and to practice writing some C++, which has become my preferred language, although I have recently cleaned up some legacy C and Python code in this repo as well.
cmake
include
C/C++ headers used by problem solutions in
src
or otherwise.legacy
Legacy code, mostly ugly Python solutions written back in 2019.
src
C++ sources for each of the problem solutions, each buildable as a standalone Google Test runner.
test
Unit tests for shared code, with a
CMakeLists.txt
that also uses the source files fromsrc
to build an overarching Google Test unit test runner with [almost]2 all the available unit tests.xorll
An XOR linked list C implementation with a driver program used by
legacy/xorll.py
, initially legacy code but recently refactored, cleaned up, and integrated into the CMake build.
Google Test >=1.10, any latest HEAD
version is likely fine.
Standalone runners built from the sources in src
are compiled with PDDCP_GTEST_STANDALONE
defined and typically contain the respective conditional compilation constructs, for example
#ifdef PDDCP_GTEST_STANDALONE
// ...
#endif // PDDCP_GTEST_STANDALONE
Some standalone runners define additional Google Test tests within these blocks.
Building is easy with the provided build.sh
build script. For usage, type
./build.sh --help
To build release binaries for this project, simply use the command
./build.sh -c Release
Simply typing ./build.sh
will build unoptimized binaries with debug symbols.
Building is easy with the provided build.bat
build script. For usage, type
build --help
To build release binaries for this project, simply use the command
build -c Release
Simply typing build
will build unoptimized binaries and the program database with debugging info. You can specify the target architecture using the -a
flag, e.g. to build 64-bit release binaries instead of the default 32-bit ones, use
build -a x64 -c Release
Currently, the Visual Studio toolset used will be whichever is the default.
Currently, C++17 is my preferred specification, although I am interested in soon moving onto C++20.↩
Standalone runners may have additional tests. See Building from source for details.↩