1785 Commits

Author SHA1 Message Date
aebd52f39f chore: update readme 2023-10-28 10:53:43 +05:30
28c27d9474 chore: format using prettier 2023-10-28 10:53:43 +05:30
0b9fad86ba fix: CI code style checking 2023-10-28 10:53:43 +05:30
d671327ebe feat: added find subsets algorithm using bitmanipulation (#1514)
* feat: added find subsets algorithm using bitmanipulation

* file name fix

* test file name fix

* fix: codespell fix

* error handled

* added test cases for error
2023-10-26 13:38:19 +00:00
f67cdc3cad Test cases project euler 6 (#1570)
* 📦 NEW: Added solution for ProjectEuler-007

* 🐛 FIX: Spelling mistake fixes

* 👌 IMPROVE: changed variable name from `inc` to `candidateValue` and thrown error in case of invalid input

* 👌 IMPROVE: Modified the code

* 👌 IMPROVE: Added test case for ProjectEuler Problem001

* 👌 IMPROVE: Added test cases for Project Euler Problem 4

* 👌 IMPROVE: auto prettier fixes

* 👌 IMPROVE: added test cases for project euler problem 6

* Updated Documentation in README.md

* Updated Documentation in README.md

---------

Co-authored-by: Omkarnath Parida <omkarnath.parida@yocket.in>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-10-26 13:35:34 +00:00
9c07bb1107 Test cases project euler 9 (#1571)
* 📦 NEW: Added solution for ProjectEuler-007

* 🐛 FIX: Spelling mistake fixes

* 👌 IMPROVE: changed variable name from `inc` to `candidateValue` and thrown error in case of invalid input

* 👌 IMPROVE: Modified the code

* 👌 IMPROVE: Added test case for ProjectEuler Problem001

* 👌 IMPROVE: Added test cases for Project Euler Problem 4

* 👌 IMPROVE: auto prettier fixes

* 👌 IMPROVE: Added test cases for project euler problem 9

* Updated Documentation in README.md

* Updated Documentation in README.md

---------

Co-authored-by: Omkarnath Parida <omkarnath.parida@yocket.in>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-10-26 13:34:20 +00:00
9a875264cc prettier fixes & added test cases for Project Euler problem 4 (#1566)
* 📦 NEW: Added solution for ProjectEuler-007

* 🐛 FIX: Spelling mistake fixes

* 👌 IMPROVE: changed variable name from `inc` to `candidateValue` and thrown error in case of invalid input

* 👌 IMPROVE: Modified the code

* 👌 IMPROVE: Added test case for ProjectEuler Problem001

* 👌 IMPROVE: Added test cases for Project Euler Problem 4

* 👌 IMPROVE: auto prettier fixes

---------

Co-authored-by: Omkarnath Parida <omkarnath.parida@yocket.in>
2023-10-24 19:19:37 +02:00
fb134b10b0 Implemented M Coloring Problem (#1562)
* Implemented M Coloring Problem

* Implemented M Coloring Problem

* Switch to a functional approach instead of class-based.
Use proper JSDoc comments.
Refine the comments and remove redundancies.

* Updated Documentation in README.md

* Proper JSDoc comment

---------

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-24 06:48:59 +00:00
7d7f109e6f Enhance readability of KnightTour (#1572) 2023-10-24 06:48:13 +00:00
60443c7eff test: add tests for Binary Equivalent Algorithm (#1560)
* test: add tests for Binary Equivalent Algorithm

* test: Refactored tests using .each()

* Update BinaryEquivalent.test.js

---------

Co-authored-by: {Harshit Malpotra} <{malpotra.harshit@gmail.com}>
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2023-10-22 17:40:53 +00:00
0315c8a538 docs: fix typo in rotateRight's docstring (#1527) 2023-10-15 17:01:55 +00:00
ad0bde6ddb Update Problem006.js (#1537) 2023-10-15 15:12:09 +00:00
46362e3d47 chore: count set bits using bitwise ops (#1532)
* Update BinaryCountSetBits.js

* Use `let` instead of `var`

---------

Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2023-10-14 16:54:11 +00:00
628c5aeb5c chore: remove unnecessary code (#1531)
Co-authored-by: IcarusTheFly <IcarusTheFly@users.noreply.github.com>
2023-10-14 16:53:23 +00:00
f77a970c78 updated BinaryHeap.test.js (#1520)
there was a console.log, which is not necessary for test cases.
2023-10-13 14:10:29 +00:00
410009157d feat: add Automorphic Numbers and tests in Math (#1496)
* feat: add automorphic number and tests

* fix: add spaces

* fix: merge tests with test.each
2023-10-12 18:53:40 +00:00
05e32481fa chore: format code (#1515)
* chore: format code

* Updated Documentation in README.md

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-10-12 06:32:18 +00:00
ce86248b1e feat: add RGB to HSL color format conversion algorithm (#1475)
* feat: add RGB to HSL color format conversion algorithm

* test: add self-tests for rgb to hsl conversion algorithm

* fix: change function code to concise format

* fix: use throw and segregate the test cases

* chore: clean up the test format

* chore: use correct styling
2023-10-11 06:15:47 +00:00
ca761d87b6 feat: add MergeTwoSortedLinkedLIsts algorithms (#1442)
* feat: add mergeTwoSortedLinkedLIsts algorithms

* remove class and unnecessary function

change the function params and return value from Node to LinkedList.
2023-10-11 06:05:09 +00:00
3823eded0a feat: add row echelon matrix algorithm (#1454)
* feat: add row echelon matrix algorithm

* test: add self-tests for row echelon algorithm

* fix: replace rounding with float tolerance

* chore: use correct style

* fix: use error tolerance and segregate testcases

* chore: add necessary explaining comments
2023-10-11 06:04:33 +00:00
a24450a629 feat: add determinant algorithm (#1438)
* feat: add determinant calculating algorithm

* test: add self-tests for determinant algorithm

* chore: add wikipedia info link

* fix: change initialization to zero

* fix: add error throw and general code improvements

* fix: add error try and catch

* fix: seperate the test loops of error cases

* clean up a bit

---------

Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2023-10-11 06:03:02 +00:00
13161bdadb feat: Combined Min Heap and Max Heap classes (#1494)
* Combined Min Heap and Max Heap classes

* Added JSdoc comments and also improved tests for binary heap

* Added private methods for BinaryHeap class

* JSDoc knows that a class is a class

I assume the @class tag is for classes implemented via constructor functions, not using ES6 class syntax

---------

Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2023-10-10 12:44:34 +05:30
c5a25665e0 bug: abs returns 0 on an empty array (#1473)
* bug: update edge case for empty array

* bug: add edge case for empty arrays

* feat: add test case for empty array

---------

Co-authored-by: Ridge Kimani <ridgekimani@gmail.com>
2023-10-10 12:34:09 +05:30
52858f8a09 feat: add algorithm to evaluate postfix string (#1441)
* feat: add algorithm to evaluate postfix strings

* feat: add test case for evaluate expression

* update: add literature reference

* fix: import name in testcase

* fix: test case result

* Make clear that this is postfix

* Update tests

* add: see reference

* fixes mentioned issues

* Fix `default` case

---------

Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2023-10-10 12:30:59 +05:30
05750bce43 chore: Add gitpod badge (#1466) 2023-10-10 12:30:31 +05:30
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