Code Monkey home page Code Monkey logo

daily-coding-problem's Introduction

daily coding problem

./dcp_banner.png

Solutions to problems from Daily Coding Problem, mostly in C++1.

History

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.

Contents

cmake

Miscellaneous CMake scripts used in the C++ CMake build.

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 from src 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.

Dependencies

Google Test >=1.10, any latest HEAD version is likely fine.

Building from source

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.

*nix

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.

Windows

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.


  1. Currently, C++17 is my preferred specification, although I am interested in soon moving onto C++20.

  2. Standalone runners may have additional tests. See Building from source for details.

daily-coding-problem's People

Contributors

phetdam avatar reimuzerg avatar

Watchers

James Cloos avatar DEVANG SHARMA avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.