* fix: #758 optimised armstrongNumber code
* fix:#758 Average Median code optimised
* feat: TwoSum function added with test cases
* revert code
* Fix: #758 used ternary operator to make code more optimised
* Feat: TwoSum function created with test cases
* Feat: TwoSum function created with test cases
* Resolved comments and changes requests
* 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>
* feat: New String Algorithm for LengthofLongestSubstringWithoutRepeatingCharacters
* Fixed Errors and Mistakes in New Algorithm LengthofLongestSubstringWithoutRepetition
* fix:#1389 Errors Fixed
* fix:#1389 Syntax and Code Errors Fixed
* fix:#1389 Errors FIxed
* Fixed All new errors
* fix:1389 Implemented suggestions and corrections
* Use @see annotation
---------
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
* test: remove ValidateUrl.test.js
The code was removed with ecac786d but the test was left here (and has been failing since then, obviously 🤣)
* test: remove conflicting test case
There is another test case that explicitly expects the `null` result when the input array only contains one element.
* Updated Documentation in README.md
---------
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Added QuadraticRoots in the Math/QuadraticRoots
* Fixed math/QyadraticRoots var to let
* Added relevant links math/QyadraticRoots
* Added relevant links math/QyadraticRoots and fixed let - const
* Added the changes and @see notation in Math/QuadraticRoots.js
* Added the changes Math/QuadraticRoots.js and return an empty []
* Readd describe block, remove redundant comments
* Changed [1,1] to [1]
---------
Co-authored-by: Dibya <Dibya.DebayanDash@siriuscom.com>
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
* test: skip test that's running way too long
It's good to have the test there, but there's no use having it running for ~30 minutes or so in the GitHub Action
close#1193
* Updated Documentation in README.md
---------
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* added an algo which finds unique element in an array
* fixed code style
* updated changes and add some explanations
* Delete package-lock.json
* Delete package.json
* added question link if anyone want to solve
* updated changes
* added package.json
* used JSDoc comment
---------
Co-authored-by: madhuredra <madhuredra.tiwari@zemosolabs.com>
* added algo for checking the number is power of four or not
* Update IsPowerofFour.js
* Update IsPowerofFour.js
* fix code style
* used proper JSDoc comment and fixed test issues
* fixed test case issue
---------
Co-authored-by: madhuredra <madhuredra.tiwari@zemosolabs.com>
* added fibonacci using formula along with test cases
* updated the changes
* added jest's each in test cases
* added jest's each for testing
* returned inline value
* removed redundant comment
* hoisted the variables
* Use shorthand
* considered adding resource of the formula
---------
Co-authored-by: madhuredra <madhuredra.tiwari@zemosolabs.com>
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
* Update ValidateUrl.js
Used JS URL API to check if URL is valid. If valid it will return the url else false;
* Update ValidateUrl.js
Fixed for #1183
* Update ValidateUrl.js
fixed code style test.
Fixed for #1183
* Delete ValidateUrl.js
Fixes: #1183
* fix error in SinglyLinkedList head method
* test: update check head test for SinglyLinkedList
* fix: code style error
* fix: remove extra semicolons
---------
Co-authored-by: Bekzod <bekzodisakov18@gmail.com>
* [feat] New algorithm
* [test] Add new test for ParityOutlier.js
* [fix] Reset indentation
* [fix] Reset indentation
* [fix] Style changes
* fix: improve code efficiency and a glitch
* test: adds a new possible test case
* fix: style fix
* fix: delete redundant comments and else statements
* [fix] style fix
* feat: Added Elementary Cellular Automata Algorithm w/ explanation, examples, and further reading
* test: Added tests for Elementary Cellular Automata Algorithm
* chore: add Wikipedia link to Elementary Cellular Automata Algorithm
* Used | Bitwise OR and ^= (Bitwise XOR) operators in calculating next Elementary Generation over Addition + and Subtraction -=
* fix: fixed error in DepthFirstSearch algorithm and test: added tests for DepthFirstSearch algorithm.
* changed traverseDFS function parameters in DepthFirstSearch.js file
* ref: KeyPriorityQueue in separate file #1298
* feat: add tests for KeyPriorityQueue #1298
* fix: _shiftDown refactored and corrected #1298
* fix: use KeyPriorityQueue in PrimMST #1298
* feat: add test for PrimMST #1298
* fix: format files #1298
* fix: minor coding style changes
* fix: use map for keys and priorities #1298
* 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
* Updated Documentation in README.md
* docs: fix CI and remove LGTM badges
LGTM is no longer a supported service and has been integrated with GitHub (which is now CodeQL).
We can create a CodeQL workflow and integrate it into the repository, however, that fits for another PR.
The shields badge API was updated, thus, causing an invalid badge: https://github.com/badges/shields/issues/8671
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>