6 Commits

Author SHA1 Message Date
86d333ee94 feat: Test running overhaul, switch to Prettier & reformat everything (#1407)
* chore: Switch to Node 20 + Vitest

* chore: migrate to vitest mock functions

* chore: code style (switch to prettier)

* test: re-enable long-running test

Seems the switch to Node 20 and Vitest has vastly improved the code's and / or the test's runtime!

see #1193

* chore: code style

* chore: fix failing tests

* Updated Documentation in README.md

* Update contribution guidelines to state usage of Prettier

* fix: set prettier printWidth back to 80

* chore: apply updated code style automatically

* fix: set prettier line endings to lf again

* chore: apply updated code style automatically

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2023-10-04 02:38:19 +05:30
6aa3314b93 fix: fixed error in the MaxProductOfThree algorithm (#1295)
* fix: fixed error in the MaxProductOfThree algorithm

Fixed the error in the MaxProductOfThree by initializing the max and min
variables to null instead of -1. The checks were then altered to check
for null instead of -1.

Also wrote more tests, which randomly generated small arrays and
compared the output of the maxProductOfThree-algorithm to the output of
a slower, but complete, function which calculates all posible
triple-products of the values of the array.

Fixes: #1294

* fix: Added newlines at the end of the files
2023-02-19 01:05:07 +05:30
5ccfafecbb npm run style result 2021-10-21 15:06:33 +05:30
67ec915d97 added throwing an error when array with <3 items is passed 2021-10-15 21:49:29 +05:30
b3377bb79c added a link to explanation 2021-10-14 21:14:48 +05:30
41ddee7074 Added Maximum product of 3 numbers in an array 2021-10-14 21:10:34 +05:30