1760 Commits

Author SHA1 Message Date
d7dc85232c feat: Key finder improvement (#1456)
* Improve algorithm

* Updated Documentation in README.md

* Updated Documentation in README.md

* Remove unwanted changes

* Make the changes fit

* Updated Documentation in README.md

---------

Co-authored-by: IcarusTheFly <IcarusTheFly@users.noreply.github.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-10-10 12:29:51 +05:30
f8ffacd481 feat: add Gray Code generation (#1425)
---------

Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2023-10-08 15:24:59 +02:00
da0ee876db Fix a typo (#1453) 2023-10-07 20:29:12 +02:00
342382932d feat: Added Euclidean Distance (#1418)
* Added Euclidean Distance

* Added documentation to params

* Use @see annotation

---------

Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2023-10-05 15:31:48 +05:30
96d122f29e fix: Enhance error handling in factorial function (#1430) 2023-10-05 15:30:28 +05:30
1de5ab7d71 Feat: TwoSum function created with test cases (#1399)
* 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
2023-10-04 09:59:01 +05:30
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
0ca18c2b2c fix: added reverse string inplace (#1406)
Co-authored-by: madhuredra <madhuredra.tiwari@zemosolabs.com>
2023-10-02 23:06:45 +05:30
36dcff8c5d feat: New String Algorithm for LengthofLongestSubstringWithoutRepeati… (#1389)
* 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>
2023-10-02 22:18:20 +05:30
b7836122ff fix: ValidateURL failing tests (#1394)
* 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>
2023-10-02 12:43:37 +05:30
f271a2cae0 Added QuadraticRoots to Math/QuadraticRoots.js (#1376)
* 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>
2023-10-02 12:42:39 +05:30
7ff3e5e49e test: skip test that's running way too long (#1393)
* 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>
2023-10-02 12:38:14 +05:30
6291d4b611 feat: Add Length Conversion (#1390) 2023-10-02 12:35:39 +05:30
0604d06ac6 fix: Average Median code cleanup (#1388) 2023-10-02 12:34:43 +05:30
964ba049d7 fix: optimised armstrongNumber code (#1374) 2023-09-30 17:35:27 +05:30
394483bff7 added contributor graph to the readme (#1367)
Co-authored-by: madhuredra <madhuredra.tiwari@zemosolabs.com>
2023-09-23 21:37:30 +05:30
6362cc967a added an algo for checking the string i palindrome or not (#1366)
Co-authored-by: madhuredra <madhuredra.tiwari@zemosolabs.com>
2023-09-23 21:30:10 +05:30
f5188ddf16 added an algo which finds unique element in an array (#1359)
* 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>
2023-09-22 14:52:11 +05:30
4fe8a67ea6 added algo for checking the number is power of four or not (#1360)
* 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>
2023-09-22 14:51:29 +05:30
6ad5b9c2b1 added numberOfDigitsUsingLog method (#1364)
* added numberOfDigitsUsingLog method

* added JSDoc comment

---------

Co-authored-by: madhuredra <madhuredra.tiwari@zemosolabs.com>
2023-09-22 13:49:13 +05:30
268796b0e8 added fibonacci using formula along with test cases (#1358)
* 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>
2023-09-19 20:29:34 +05:30
9757e2bee3 fixed typo (#1363)
Co-authored-by: unknown <nickjr@gmail.com>
2023-09-19 16:40:32 +05:30
00e40e6f06 Fix/code smells (#1338)
* ♻️ refactor: improving and fixing some code

* Updated Documentation in README.md

* ♻️ refactor: improving isLeapYear

* 🐛 chore: back changes

* 🐛 fix: using reduce instead forEach

* 🐛 fix: using reduce instead forEach

* 🐛 fix: removing duplicated code

* 🐛 chore: removing .js

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-08-21 23:36:43 +05:30
9b32db29d8 Update: Added Unary Operator in SumOfDigits algorithm (#1348)
* Update: Added Unary Operator in SumOfDigits algorithm

* Update: Added Unary Operator in SumOfDigits algorithm
2023-08-15 01:24:00 +05:30
53b1f667ee Project Euler 021 (#1347)
* feat: Project Euler Problem 21

* test: Project Euler 21

* fix: test description in Project Euler 21
2023-08-12 19:48:14 +05:30
ecac786da7 Remove URL validation (#1335)
* 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
2023-07-14 18:39:12 +05:30
6debd5c1a2 chore: 🤖 remove extra lines (#1330)
I ran the command yarn style and that got failed, so I fixed that
2023-06-17 01:49:21 +05:30
1666c3a0be fix error in SinglyLinkedList head method (#1322)
* 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>
2023-05-15 13:35:09 +05:30
331a4d26cf feat: Ciphers/MorseCode Algorithm (#1315)
* [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: New algorithm

* fix: fixed custom code symbols

* test: add test for MorseCode

* test: add case with custom code symbols

* delete files from main branch

* fix: style fix

* fix: style fix

* fix: delete unnecessary quotes
2023-05-01 11:47:47 +05:30
e6df6ebad6 New Algorithm: Parity Outlier (#1314)
* [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
2023-05-01 11:46:48 +05:30
84b01aeb61 fixed: to correct grammatical mistakes (#1307)
Corrected grammatical mistakes
2023-03-23 09:05:36 +05:30
1381ed0c17 feat: add dutchNationalFlagSort implementation (#1305)
* feat: add dutchNationalFlagSort implementation

* fix: add test, fit code style

* fix: add link to directory.md
2023-03-04 10:39:21 +05:30
327e18f450 Elementary cellular automata (#1302)
* 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 -=
2023-03-04 10:37:51 +05:30
fc06690672 fixes: #1280 and test: added tests for DFS algorithm (#1303)
* fix: fixed error in DepthFirstSearch algorithm and test: added tests for DepthFirstSearch algorithm.

* changed traverseDFS function parameters in DepthFirstSearch.js file
2023-03-02 00:03:24 +05:30
566d9103cd fix: refactor PrimMST and fix bug in PriorityQueue (#1300)
* 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
2023-02-23 20:05:45 +05:30
0c427580f1 Make ArbitraryBase Unicode-aware (#1299)
* Make ArbitraryBase Unicode-aware

https://mathiasbynens.be/notes/javascript-unicode#counting-symbols

* Fix performance bug and add Unicode test

* Add BigInt version and push output chars to array
2023-02-23 20:04:47 +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
5ce828b3fe feat: add maxConsecutiveOnes implementation (#1285) 2023-02-13 17:11:28 +05:30
55c18aef69 feat: add maxConsecutiveOnesIII implementation (#1286) 2023-02-13 17:10:20 +05:30
49bd1fd0c2 Adding to backtracking (#1289)
* adding generate-parenthses algorithm

* adding generateParenthses algorithm

* adding generate parentheses algorithm

* fixing comments according to the JDoc comments, cleaning code

* fixing comments
2023-02-13 17:09:31 +05:30
c40e4cf4d4 Refactored code to improve performance of some methods (#1284)
* refactored code to improve perfomance

* added 'check tail' test

* corrected styling and spelling mistake
2023-02-08 18:16:57 +05:30
c252df5d10 feat: add houseRobber implementation (#1282) 2023-02-07 22:21:00 +05:30
002b10a5aa docs: fix typos (#1283)
* docs: fix typos

* fix
2023-02-07 22:20:28 +05:30
8cd86b1eda chore(deps): bump json5 from 1.0.1 to 1.0.2 (#1274)
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-08 19:17:15 +05:30
7ea7d7b8c6 docs: improve the issue forms (#1272) 2022-12-19 21:38:51 +05:30
cb4c40e95c docs: improve the contributing guidelines (#1271) 2022-12-18 15:50:06 +05:30
b36b45888e docs: fix CI and remove LGTM badges (#1269)
* 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>
2022-12-17 11:52:15 +05:30
65cceae0be algorithm: signum (#1266) 2022-12-08 18:57:42 +05:30
f954fb1ff7 Update README.md (#1268) 2022-12-08 18:56:10 +05:30
18a91573c3 Added a new Maths algorithm to determine if two non-null integers are "friendly numbers" (#1267) 2022-11-30 16:51:08 +05:30