88 Commits

Author SHA1 Message Date
1554ba5f9c test: add tests for NumberOfSubsetEqualToGivenSum (#1661) 2024-05-25 16:31:54 +05:30
e2b9754862 tests: add tests of LongestIncreasingSubsequence (#1660) 2024-05-23 19:45:08 +02:00
6fe21d21e9 chore: convert functions to an ES2015 classes (#1656)
* chore: convert functions to an ES2015 classes

* remove unnecessary functions
2024-04-13 23:21:54 +05:30
39d01138ec Abbreviation (#1547)
* Abbreviation

* Updates from code review
2023-11-15 19:25:30 +05:30
e5af4c24b4 Enhance readability of ZeroOneKnapsack.js (#1574)
* Enhance readability of ZeroOneKnapsack.js

* Update ZeroOneKnapsack.js

---------

Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2023-10-30 11:04:06 +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
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
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
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
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
5668e64b29 algorithm: unique paths 2 (#1257)
* algorithm: add UniquePaths2 algo and a test for it

* fix: fix inaccuracies and spelling errors
2022-10-31 22:37:26 +05:30
21d73b6447 algorithm: unique paths (#1211)
* dp problem

* update Directory.md

* suggested changes
2022-10-20 20:29:36 +05:30
e65211299b feature: add fast fibonacci algorithm (#1155) 2022-10-17 01:54:44 +05:30
ede60b81d9 algorithm: catalan numbers (#1149) 2022-10-09 17:45:26 +05:30
ea7d06ad57 tests: Levenshtein Distance (dynamic programming solution) (#1114) 2022-10-06 00:38:23 +05:30
9528c71107 Added testcases for Zero One Knapsack (#1109) 2022-10-02 11:19:31 +05:30
59760f75c4 merge: Add test case to Edit Distance Algorithm (#1044)
* Add test case to Edit Distance Algorithm

* Updated Documentation in README.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-06-12 20:14:11 +05:30
8bf29fe17c merge: Optimize the space complexity of the fibonacci algo (#899)
* docs: update js doc

* feat: add number type validation condition

* pref: Optimize space complexity

remove the Array from the algo and used two flag varible to calculate last two numbers & optimize the sapce complexity O(n) to O(1)

* test: add test case for invalid types
2022-02-22 16:20:46 +05:30
7560beb068 merge: Add tests and docs for the Longest Common Subsequence algorithm (#867)
* Refactors, adds tests and comments to longest common subsequence algorithm

* Refactor docs for longest common subsequence algorithm

* Add links to wikipedia and leetcode

* Fix styling

* Refactor variable naming and jsdoc
2021-12-08 17:20:23 +05:30
62b151eb69 merge: Fixes: #860 (#861) 2021-12-02 16:24:47 +05:30
4e7a15694b merge: add test case and description (#842) 2021-11-22 22:23:48 +05:30
02a4cee5c2 merge: optamization,documantation,return Array[bool] => Array[primes only], test case (#841) 2021-11-20 17:15:36 +05:30
93e57b0de5 merge: Add FibonacciNumber.js test case and update the decription of function. (#840) 2021-11-20 16:21:25 +05:30
f379475723 merge: Add TribonacciNumber in dp (#839) 2021-11-20 09:43:27 +05:30
65931be0f8 merge: fixed argument data type (#835) 2021-11-08 09:59:07 +05:30
308b022b03 merge: Sliding window (#833)
* new algorithm 'Sliding-Window' added with example 'Longest Substring Without Repeating Characters'

* new example of sliding window 'Permutation in String' added

* chore: add `ignore_words_list`

* sliding-window moved into Dynamic-programming directory

Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>
2021-11-03 09:33:20 +05:30
072523d594 merge: Fix spellings (#821)
* chore: remove codespell from ci

* feat: add codespell workflow

* fix: codespell workflow

* fix: ignore spellings in directory

* chore: fix spellings

./Dynamic-Programming/KadaneAlgo.js:2: contiguos ==> contiguous
./Dynamic-Programming/KadaneAlgo.js:14: posible ==> possible

* chore: fix spelling

./Dynamic-Programming/SieveOfEratosthenes.js:4: upto ==> up to

* chore: fix spellings

./Dynamic-Programming/MaxNonAdjacentSum.js:22: Exmaple ==> Example

* chore: fix spelling

./Project-Euler/test/Problem010.test.js:4: upto ==> up to
./Project-Euler/test/Problem010.test.js:8: upto ==> up to
./Project-Euler/test/Problem010.test.js:12: upto ==> up to

* chore: fix spelling

./String/AlphaNumericPalindrome.js:10: recieves ==> receives
./String/AlphaNumericPalindrome.js:10: sting ==> string
./String/AlphaNumericPalindrome.js:46: varaible ==> variable

* chore: fix spelling

./String/DiceCoefficient.js:3: stings ==> strings

* chore: fix spelling

./String/test/DiceCoefficient.test.js:9: atleast ==> at least

* chore: fix spelling

./String/test/MaxWord.test.js:8: ba ==> be

* chore: ignore `PermutateString.test.js`

* chore: fix spelling

./String/test/CheckVowels.test.js:62: occurances ==> occurrences

* chore: ignore `SubsequenceRecursive.js`

* chore: fix spelling

./Conversions/TemperatureConversion.js:2: arguement ==> argument

* chore: fix spelling

./Conversions/RailwayTimeConversion.js:7: Formate ==> Format
./Conversions/RailwayTimeConversion.js:8: Formate ==> Format

* chore: remove Linear Algebra

The deleted directory hosted a package which are not accepted by this repository.

* Auto-update DIRECTORY.md

* chore: fix spelling

* chore: fix spellings

* merge: Created composite Simpson's integration method. Tests included. (#819)

* Created composite Simpson's integration method.Tests included

* Minor corrections

* Auto-update DIRECTORY.md

* Styled with standard.js

* chore: remove blank line

* chore: remove blank line

Co-authored-by: ggkogkou <ggkogkou@ggkogkou.gr>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: remove codespell from ci

* feat: add codespell workflow

* fix: codespell workflow

* fix: ignore spellings in directory

* chore: fix spellings

./Dynamic-Programming/KadaneAlgo.js:2: contiguos ==> contiguous
./Dynamic-Programming/KadaneAlgo.js:14: posible ==> possible

* chore: fix spelling

./Dynamic-Programming/SieveOfEratosthenes.js:4: upto ==> up to

* chore: fix spellings

./Dynamic-Programming/MaxNonAdjacentSum.js:22: Exmaple ==> Example

* chore: fix spelling

./Project-Euler/test/Problem010.test.js:4: upto ==> up to
./Project-Euler/test/Problem010.test.js:8: upto ==> up to
./Project-Euler/test/Problem010.test.js:12: upto ==> up to

* chore: fix spelling

./String/AlphaNumericPalindrome.js:10: recieves ==> receives
./String/AlphaNumericPalindrome.js:10: sting ==> string
./String/AlphaNumericPalindrome.js:46: varaible ==> variable

* chore: fix spelling

./String/DiceCoefficient.js:3: stings ==> strings

* chore: fix spelling

./String/test/DiceCoefficient.test.js:9: atleast ==> at least

* chore: fix spelling

./String/test/MaxWord.test.js:8: ba ==> be

* chore: ignore `PermutateString.test.js`

* chore: fix spelling

./String/test/CheckVowels.test.js:62: occurances ==> occurrences

* chore: ignore `SubsequenceRecursive.js`

* chore: fix spelling

./Conversions/TemperatureConversion.js:2: arguement ==> argument

* chore: fix spelling

./Conversions/RailwayTimeConversion.js:7: Formate ==> Format
./Conversions/RailwayTimeConversion.js:8: Formate ==> Format

* chore: remove Linear Algebra

The deleted directory hosted a package which are not accepted by this repository.

* Auto-update DIRECTORY.md

* chore: fix spelling

* chore: fix spellings

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: no need to check filenames

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: ggkogkou <76820848+ggkogkou@users.noreply.github.com>
Co-authored-by: ggkogkou <ggkogkou@ggkogkou.gr>
2021-10-28 15:37:43 +05:30
d38ebe5199 chore: Merge pull request #768 from lvlte/issues/720
Changes for consolidation
2021-10-21 19:32:55 +05:30
5ccfafecbb npm run style result 2021-10-21 15:06:33 +05:30
e4d69f8d9c chore: Merge pull request #776 from raghhavtaneja/raghhavtaneja-patch-1
Create RodCutting.js
2021-10-20 15:16:04 +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
5210273104 resolved style issues in the code 2021-10-12 16:55:56 +05:30
0ae960c4ee added tests for rodCutting and made some changes 2021-10-12 11:06:21 +05:30
0312ee731e Create RodCutting.js 2021-10-11 21:54:41 +05:30
df4a783b06 Complying with JavaScript Standard Style (npx standard --fix). 2021-10-11 15:49:24 +02:00
29d2a84090 Dynamic-Programming : remove live code & console.log, leave examples as comments. 2021-10-10 17:00:21 +02:00
ed49e122a7 tried to fix tests 2021-10-06 15:34:08 +05:30
5a59d1efc0 changes made 2021-10-06 15:02:37 +05:30
3a8e336262 added documentation, js standard style and jest testing to kadane algorithm file. 2021-10-06 14:45:07 +05:30
e27bc0a702 resolved conflicts 2021-10-05 14:05:11 +05:30
1c22f65ce7 fixed the issue in Trie file and typo in sudoku 2021-10-05 12:53:38 +05:30
1589263947 fixed some spellings 2021-10-05 12:49:23 +05:30
199d2637cc Update LongestPalindromicSubsequence.test.js 2021-10-04 17:39:26 +05:30
e0c5d494ae Added space after comma 2021-10-03 21:20:53 +05:30
63ceac0925 Added test cases for TrappingRainWater 2021-10-03 21:13:08 +05:30