124 Commits

Author SHA1 Message Date
a5945e37c2 fix: throw error instead of returning it (#1624) 2024-02-29 10:25:11 +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
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
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
00a97d5e1b algorithm: percentage of letter (#1261) 2022-11-01 09:15:02 +05:30
7fb121508d algorithm: ZFunction (#1239)
* algorithm: ZFunction

* made requested changes

* corrected spelling mistakes

* made requested changes
2022-10-31 22:12:06 +05:30
55f502e1f1 algorithm: count letters (#1164) 2022-10-19 16:52:27 +05:30
c365e82d08 Adding testcases for Boyer Moore Algorithm (#1135) 2022-10-07 10:44:11 +05:30
d05bbf77c6 algorithm: first unique char in a string (#1103)
* feat: Added Algo first unique char in a string.

* Optimised algo to linear time complexity

* removed double quotes

* Review changes: if-else logic
2022-09-22 17:20:04 +05:30
6c718c01d4 add: countSubstrings function implementation (#1091) 2022-09-07 15:03:24 +05:30
ad41e8cc1c fix: spellings which are making ci fail (#1089)
* Updated Documentation in README.md

* chore: remove wrong spelling

* ci: recognize "falsy" as correct spelling

* chore: fix spelling

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-09-05 11:06:24 +05:30
bbbf343971 merge: Fix IsPalindrome Big-O analysis (#1054)
* Fix IsPalindrome Big-O analysis

* Updated Documentation in README.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-07-01 22:52:04 +05:30
6b06b3a37f merge: Add new IsPalindrome implementation (#1046) 2022-06-16 22:28:59 +05:30
d59213d0b8 merge: Add test case to CheckPascalCase Algorithm (#1029) 2022-05-31 14:25:31 +05:30
162e90f3d2 merge: Add test case to palindromeRearranging Algorithm (#1030)
* Add test case to CheckPascalCase Algorithm

* Add test case to palindromeRearranging Algorithm

* no need
2022-05-31 14:24:57 +05:30
07e77fac1c merge: Add testcase to AlternativeStringArrange Algorithm (#1026)
* Add test case to HexToRGB algorithm

* Add testcase to AlternativeStringArrange Algorithm

* deleting coppy file
2022-05-30 19:50:04 +05:30
9befd923b1 Add testcase to checkKebabCase (#1027) 2022-05-30 16:18:42 +02:00
c865654f27 Clean up phone number formatting (#1015) 2022-05-16 18:48:16 +02:00
cbc669aa9d merge: Upgraded Algorithm of alpha numeric palindrome (#1006)
* feat: improved memoize function

used Map instead of object & used the JSON.stringfy method for generate a valid string as a key

* docs: modified documentation

* style: format with standard

* docs: modified stringify doc

* refactor: remove two repetition implementation

* feat: added validation, test codes

* chore: remove useless words

* feat: added types for jest

* chore: added link box

* feat: added new validation test casses & methods

* style: formated with standard

* feat: added parse method & test cases

* docs: added js docs

* chore: added default import export

* feat: imporved algorithm via replace method

* test: added two test cases

* feat: added jest type for suggestions

* feat: added `reduceRight` & `trim` method

* chore: added helper variable

* feat: added new rotation option

* Revert "chore: added helper variable"

This reverts commit 489544da0a3d479910fbea020d3be3d0d10681bf.

* remove: yarn lock

* chore: fix grammer

* feat: used replace method & added test case

* feat: remove revert

* chore: added new line

* feat: optimized algo n to n / 2 & replaced test cases

* chore: update node version

* chore: set node version to lts

* chore: updated the node version & added engines prop

* resolve: removed while loop

* chore: added right shift ops comment

* chore: update comment

* chore: removed abs

Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>
2022-05-07 17:42:50 +05:30
28062533b6 merge: Upgrade max char (#983)
* feat: improved memoize function

used Map instead of object & used the JSON.stringfy method for generate a valid string as a key

* docs: modified documentation

* style: format with standard

* docs: modified stringify doc

* refactor: remove two repetition implementation

* feat: added validation, test codes

* chore: remove useless words

* feat: added types for jest

* chore: added link box

* feat: added new validation test casses & methods

* style: formated with standard

* feat: added parse method & test cases

* docs: added js docs

* chore: added default import export

* feat: imporved algorithm via replace method

* test: added two test cases

* feat: added jest type for suggestions

* feat: added `reduceRight` & `trim` method

* chore: added helper variable

* feat: added new rotation option

* Revert "chore: added helper variable"

This reverts commit 489544da0a3d479910fbea020d3be3d0d10681bf.

* remove: yarn lock

* chore: fix grammer

* feat: used replace method & added test case

* feat: remove revert

* chore: added new line

* feat: added filter for alphabets only

* resolve: added empty validation improved ignore pattern

* chore: reverted to for of loop
2022-05-02 14:51:16 +05:30
7881cb5f16 Add Boyer-Moore string search algorithm (#990)
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-04-23 13:06:41 +02:00
27ae62e5c9 merge: reduce upper & lower & add export default (#960) 2022-03-28 14:59:21 +05:30
3b9af469f6 merge: added reduceRight & trim method (#961) 2022-03-28 14:27:32 +05:30
9681688797 merge: Add CheckExceeding function (#907)
* feat: add checkExceeding function

* test: add test cases of checkExceeding func

* test: add more not increasing words
2022-03-22 14:37:42 +05:30
35ba618355 merge: Added replace method to Upper (#916)
* feat: added replace method

* resolve: fix algo
2022-03-05 14:40:39 +05:30
eb748ae78d merge: Fixed wordOccurrence algorithm (#909)
* resolved: upgrade the algoritm

* docs: add js doc
2022-03-02 10:43:01 +05:30
e8de031539 merge: Improved pangram algorithm using regular expressions (#906)
* feat: used regex instead of Set

* docs: add js doc

* docs: add comments of workable code

* style: format via standardJs

* docs: add details explanation of pangram regex

* docs: add example

* feat: add two implemetaion of

The first implementation with regex and second via HashSet & add the test code for both

* chore: add QNA format of **Pangram**

* style: format with standardJs

* resolve: removed 'Ans'
2022-02-28 10:59:09 +05:30
d466be977e merge: Upgrade checkAnagram function & Fixes (#902)
* pref: optimize the algo via reduce & replace method

* feat: add TypeError for invalid types

* test: upgrade test case for invalid types

* docs: add js doc

* test: modify the case-sensitive test case

* pref: Optimize algo & add case-insensitive mode

* style: format with standard style

* docs: fix the js doc

* docs: rename function name & add comments

* feat: add chackAnagramViaMap function

* test: add test case for checkAnagramViaMap func

* fix: remove **Via** from functions name

* style: fix alignment of js doc

* chore: grammar fix

Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>
2022-02-25 21:56:30 +05:30
041918d7b7 merge: Upgrade Lower function (#894)
* docs: update the js doc

* pref: Optimize algo via regex

ignore the useless traverse in best case via regex and String.prototype.replace

* test: add some new test cases

* fix: styled with standard

* refactor: remove useless variable
2022-02-19 17:08:55 +05:30
68ca0ceeef merge: optimize the countVowels algo (#886)
* pref: optimize the count vowels algo

simplify the algo by using regex and String.prototype.match method, and modified the JS Doc

* fix: resolve all requests

* pref: optimize the algo by regex

ignore the useless traverse in best case by the help of regex and String.prototype.replace method

* test: add four new test cases

* Revert "test: add four new test cases"
This reverts commit 4609833da146beafe839682d7558edf9f64c96fc.

* style: fromat with standard js
2022-02-17 17:30:04 +05:30
c30b897324 merge: count Vowels (#864) 2021-12-11 13:30:26 +05:30
43515a646b merge: Add Upper (#862) 2021-12-06 21:26:14 +05:30
4c27e1534e merge: Add lower (#863) 2021-12-04 11:01:58 +05:30
6fb649e53d merge: Add ValidateUrl in String (#856)
* Add ValidateUrl in String

* change regex

* Bug fix
2021-12-02 16:23:54 +05:30
bf681d1a91 merge: alphaNumericPlaindrome optamization (#857) 2021-11-29 20:45:18 +05:30
85b0571d81 chore: Strings: Credit Card Validation (#830)
* Add credit card number validator

- Validates the credit card number based on Luhn algorithm

* Test Cases: ValidateCreditCard

* Auto-update DIRECTORY.md

* Fix: Spell check

* Add references and move const inside function

* Add comments

* Fix trailing spaces

* Add short description

* Remove trailing spaces

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2021-11-04 13:34:52 +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
db5b4af730 formatting with standardjs 2021-10-20 18:43:26 +05:30
81f5f403fa removed test case comments 2021-10-16 15:55:18 +05:30
3131b9a989 fixed the code style error 2021-10-16 15:53:24 +05:30
04fbf92480 fixed the miss spelled the file name 2021-10-16 15:45:12 +05:30
e18718b7d5 Remove live code & console.log, leave examples as comments. 2021-10-11 14:07:10 +02:00
1d1729822a running the test and style commands 2021-10-10 12:41:22 +05:30
a13ea05ecf adding test file for AlphaNumericPalindrome algorithm 2021-10-10 12:34:10 +05:30
5d387d3de1 adding AlphaNumericPalindrome.js, an algorithm question from freecode 2021-10-10 12:31:00 +05:30
cbe7e0c89f Comply with ESM syntax. 2021-10-09 13:18:40 +02:00