26 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
78f023fdd1 algorithm: Log2 using bitwise operations (#1132) 2022-10-09 17:36:23 +05:30
8461271fc8 added check for Integer (#1137) 2022-10-07 17:16:28 +05:30
80cea0884b merge: Add testcases of BinaryCountSetBits function (#922) 2022-03-15 14:39:18 +05:30
d38ebe5199 chore: Merge pull request #768 from lvlte/issues/720
Changes for consolidation
2021-10-21 19:32:55 +05:30
d6364548aa Check if number is already power of two 2021-10-11 20:24:38 +03:00
372348f64c add algorithm that calculates next power of two 2021-10-11 20:13:36 +03:00
df4a783b06 Complying with JavaScript Standard Style (npx standard --fix). 2021-10-11 15:49:24 +02:00
5c4be7604d Remove live code & console.log (Backtracking, Bit-manipulation, Ciphers). 2021-10-09 17:47:03 +02:00
8812f63ba2 Small fixes + comply with JS standard styles. 2021-10-09 12:23:49 +02:00
7ce688b9db Updated the code and did the required changes 2021-10-08 21:20:21 +05:30
e978f4365d Add code and tests for checking power of 2 2021-10-08 15:41:45 +05:30
1589263947 fixed some spellings 2021-10-05 12:49:23 +05:30
504dbb0c30 Statement changes Added 2021-07-05 16:25:23 +05:30
58fca82ec3 Changed Test statement 2021-07-05 11:09:46 +05:30
51a9126053 Added SetBit.js, SetBit.test.js in Bit-Manipulation directory 2021-07-04 21:47:53 +05:30
89f5def29a updated file by JS standard 2020-10-01 13:29:41 +05:30
ca1f5385da renamed file 2020-10-01 13:14:58 +05:30
cc21081531 added bit_manipulation folder & binary_count_setbits.js file 2020-10-01 13:12:20 +05:30