17 Commits

Author SHA1 Message Date
79b93d35b6 style: remove redundant eslint suppressions (#1667) 2024-06-12 01:40:48 +05:30
d920e7f427 refactor: reduce code duplication in FloodFill (#1645)
* tests: add tests checking if floodFill funtions throw when location is outside

* refactor: reduce code duplication by adding `checkLocation` to `FloodFill`

* refactor: add and use `isInside`

Co-authored-by: appgurueu <34514239+appgurueu@users.noreply.github.com>

* Deduplicate further

---------

Co-authored-by: appgurueu <34514239+appgurueu@users.noreply.github.com>
2024-04-03 20:54:06 +05:30
1b66d86bd7 Implemented Palindrome Partitioning using Backtracking algorithm (#1591)
* Implemented Palindrome Partitioning using Backtracking algorithm

* fix:Updated palindromePartition algorithm

* code clean up

* Rephrase doc comment & move to appropriate function

---------

Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2023-11-28 09:58:32 +05:30
e9e3ea4684 Implemented Partition Problem, Recursive problem (#1582)
* Add Tug of War solution using backtracking

* Updated Documentation in README.md

* Added Tug of war problem link

* Updated Documentation in README.md

* Updated Documentation in README.md

* Refactor tugOfWar: remove unused vars, optimize initialization, and remove redundant checks

* Added Function Export Statment

* Updated Documentation in README.md

* Resolved Code Style --Prettier

* Rename "backtrack" to "recurse"

* Fix test case: The difference needs to be exactly 1.

* Code Modification: subsets should have sizes as close to n/2 as possible

* Updated test-case of TugOfWar

* Changed TugOfWar problem to Partition

* Modified partition problem

* Updated Documentation in README.md

* fixed code style

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2023-11-15 19:22:57 +05:30
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
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
96d122f29e fix: Enhance error handling in factorial function (#1430) 2023-10-05 15:30:28 +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
5364a1c31b chore: check for invalid input to factorial (#1229) 2022-10-27 20:45:53 +02:00
63a3394d95 algorithm: letter combinations (#1209) 2022-10-21 16:54:37 +05:30
e32fdce52f Rename palindrome test to Palindrome to follow standard (#1159) 2022-10-10 11:29:26 +05:30
833d05d8d0 merge: binarySearch (#884)
* required, optional param left-to-right approch in BS

* base case return early to avoid nested if block

* codes formated with standard.js
2022-02-16 14:24:32 +05:30
6f1edd16f5 merge: Add test Case for Palindrome Recursive (#855)
* Add test Case for Palindrome Recursive

* Update Checks
2021-11-28 13:34:54 +05:30
027c0d6307 merge: Add test cases (#854) 2021-11-28 11:49:11 +05:30
51415f8a12 merge: Add test case (#851)
* Add test case

* minor fix

* delete files

* rename file
2021-11-27 12:58:18 +05:30
2fb0d48d94 merge: Add test cases, optamization of code, and Add description of function (#848)
* Add test cases, optamization of code, and Add description of function

* update testcase
2021-11-26 22:08:43 +05:30
1cef191494 merge: Made all tests follow file strcture convention already in-place (#820)
* add empty line to end of file

* Move all test files to /test following convention
2021-10-28 10:00:04 +05:30