https://github.com/farhangamary/cpp-coding-challenges
A collection of C++ challenges covering both algorithmic problems and language-specific concepts. Explore solutions to real-world problems, C++ standard features, and best practices. Contributions are highly welcomed!
https://github.com/farhangamary/cpp-coding-challenges
algorithms cmake cplusplus cpp graphs msvc preprocessor stl string trees
Last synced: over 1 year ago
JSON representation
A collection of C++ challenges covering both algorithmic problems and language-specific concepts. Explore solutions to real-world problems, C++ standard features, and best practices. Contributions are highly welcomed!
- Host: GitHub
- URL: https://github.com/farhangamary/cpp-coding-challenges
- Owner: farhangamary
- Created: 2025-03-25T02:46:35.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-26T22:55:40.000Z (over 1 year ago)
- Last Synced: 2025-03-26T23:32:17.726Z (over 1 year ago)
- Topics: algorithms, cmake, cplusplus, cpp, graphs, msvc, preprocessor, stl, string, trees
- Language: C++
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cpp_challenges
This is a collection of C++ coding challenges, and it will be expanded over time. Currently, it includes one completed challenge, with more challenges to be added in the future.
## Contributing Challenges
If you have a C++ coding challenge you'd like to contribute, please create a new issue in this repository! The process is simple:
Open a new issue and describe the challenge in detail, including:
- A clear problem statement
- Input/output specifications
- Example test cases
Once the issue is created, we'll work together to implement solutions and add tests to ensure correctness.
Thank you for contributing!
## Project Structure
The project is organized into categories.
Each challenge is located in its respective category. Each category contains the solution as well as a corresponding test in the test directory.
## Requirements
- CMake 3.8 or higher
- gcc/g++ for linux
- msvc(cl.exe) - the compiler for windows os.
- vcpkg - for package management - for windows os.
- googletest
## Setup
### Windows Setup (MSVC)
1. Clone the repository
2. Install `vcpkg` and integrate it with Visual Studio (see [vcpkg setup](https://github.com/microsoft/vcpkg/blob/master/docs/users/integration.md)).
3. Install dependencies (GoogleTest):
```bash
vcpkg install gtest
```
4. Open the project in MS Visual Studio.
5. Build the project and start tests.
### Linux Setup
1. Clone the repository
2. Install dependencies:
```bash
sudo apt-get install cmake g++ libgtest-dev
```
3. Run CMake: create a build directory and run::
```bash
cmake -B build/ -S .
```
4. Build the project: go to the build directory and run:
```bash
make --build build/
```
## Running Tests
You can run the tests using CTest or directly from Visual Studio.
- To run tests from the terminal, go into the build directory and run:
```bash
ctest --output-on-failure
```
- Or use the Visual Studio test runner.
- You can also run the generated executable binaries of the tests.
## License
This project is licensed under the MIT License.