Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/it1shka/sofixit

My solution for 'Code Wars' competition
https://github.com/it1shka/sofixit

Last synced: about 1 month ago
JSON representation

My solution for 'Code Wars' competition

Awesome Lists containing this project

README

        

## Submission for competition "Code Wars" by Sofixit company

## Check out my Web Visualization:
[GitHub Pages](https://it1shka.github.io/material-visualization/)
[GitHub Repo](https://github.com/it1shka/material-visualization)

## Performance
**10** elements -- **15 ns**

**100** elements -- **50 ns**

**1000** elements -- **460 ns**

**1000000** elements -- **0.46 ms**

Written in C++23 (C++17 also should work fine)

In *__solution/function.h__* you will find definition of my

best function so far:
```cpp
template
auto materialFast(const std::array& spaceship) -> int;
```

as well as some other attemps which are not that good

In *__tests/function_tests.cpp__* you will find a file

that provides test cases for my solution

The way you can launch tests is

__building the *sofixit_tests* target with CMake__

Please, make sure that you have installed CMake 3.23

Tests can be compiled and run in the following manner:

```shell
# cloning my repo from github
git clone https://github.com/it1shka/sofixit
cd sofixit
# initializing CMake
cmake .
# building and running tests
cmake --build tests
cd tests
./sofixit_tests
```