Commit Graph
3669 Commits
Author SHA1 Message Date
Ali Satwat KhanChristian Clausspre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
eea1bacfe0 fix: raise ValueError in encode() for non-lowercase input (#14936)
* fix: raise ValueError in encode() for non-lowercase input

encode() previously accepted uppercase letters, digits, and other
non-lowercase characters silently, producing incorrect/out-of-range
values (e.g. negative numbers for uppercase letters) instead of
failing. Add input validation using str.islower() and str.isalpha()
to raise a ValueError when the input isn't purely lowercase a-z.
Added a doctest covering the new error case.

* resolved doctest

* Fix Ruff 0.16 lint failures

* Enhance encode function error handling examples

Update error handling in encode function to include examples for mixed case and invalid characters.

* Fix indentation in test_cancer_data function

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-07-31 18:07:20 +02:00
hojen2pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clauss
758d487394 Upgrade ruff in pre-commit (#14982)
* Fix invalid Python 2 syntax in except clause

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update ruff-pre-commit version to v0.16.1

* Fix indentation in test_cancer_data function

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2026-07-31 17:37:49 +02:00
Ali Satwat KhanandChristian Clauss 948d4cb01e Improve docstrings in sorts/bubble_sort.py (#14924)
* docs: expand bubble sort docstrings with algorithm explanation

Add a concise description of how bubble sort works (repeated
adjacent comparisons/swaps until a pass makes no swaps) and note
time/space complexity for both the iterative and recursive
implementations. No behavior changes; all existing doctests pass.

* Fix Ruff 0.16 lint failures

* S310

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2026-07-30 20:29:25 -04:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 25bcced0f3 Bump actions/setup-python from 6 to 7 (#14965)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 6 to 7.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-21 08:13:38 -04:00
pre-commit-ci[bot]andpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> c0db072a13 [pre-commit.ci] pre-commit autoupdate (#14906)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.15.15 → v0.15.20](https://github.com/astral-sh/ruff-pre-commit/compare/v0.15.15...v0.15.20)
- [github.com/tox-dev/pyproject-fmt: v2.23.0 → v2.25.1](https://github.com/tox-dev/pyproject-fmt/compare/v2.23.0...v2.25.1)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-07-06 21:04:35 +02:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> e3b01ecd12 Bump actions/checkout from 6 to 7 (#14820)
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-19 06:00:40 +02:00
pre-commit-ci[bot]andpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 6c0462028f [pre-commit.ci] pre-commit autoupdate (#14747)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.15.14 → v0.15.15](https://github.com/astral-sh/ruff-pre-commit/compare/v0.15.14...v0.15.15)
- [github.com/tox-dev/pyproject-fmt: v2.21.2 → v2.23.0](https://github.com/tox-dev/pyproject-fmt/compare/v2.21.2...v2.23.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-06-01 20:53:38 +02:00
pre-commit-ci[bot]pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clausscclauss
456d644c23 [pre-commit.ci] pre-commit autoupdate (#14629)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.15.9 → v0.15.12](https://github.com/astral-sh/ruff-pre-commit/compare/v0.15.9...v0.15.12)
- [github.com/tox-dev/pyproject-fmt: v2.21.0 → v2.21.1](https://github.com/tox-dev/pyproject-fmt/compare/v2.21.0...v2.21.1)

* updating DIRECTORY.md

* Update pre-commit hook versions

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-05-22 13:51:30 +02:00
a9f2e72541 Added Johnson's algorithm for all-pairs shortest paths (#13340)
* Fix typos in Johnson's algorithm (nd -> and) to pass codespell

* Rename type aliases and h parameter to follow snake_case and descriptive naming

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: John Law <johnlaw.po@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-20 20:16:03 +02:00
Ali AlimohammadiandJohn Law 33a8e0f21a feat: add Ramer-Douglas-Peucker polyline simplification algorithm (#14372)
* feat: add Ramer-Douglas-Peucker polyline simplification algorithm

* Use descriptive parameter names

* Update geometry/ramer_douglas_peucker.py

* Update geometry/ramer_douglas_peucker.py

* Update ramer_douglas_peucker.py

* Update ramer_douglas_peucker.py

* Update ramer_douglas_peucker.py

---------

Co-authored-by: John Law <johnlaw.po@gmail.com>
2026-05-20 00:43:43 +01:00
Alessandro Molinaripre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>John Law
144ef9c022 Fix type hints in sorts/tim_sort.py, relates to #14457 (#14474)
* Add type hints to tim_sort.py, relates to #14457

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix ruff PYI041 error: use float instead of int | float

* Fix mypy error: support str and tuple inputs as defined in doctests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix ruff E501: wrap binary_search parameters to respect 88 char limit

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Refactor generics to use Python 3.12 type parameter syntax (PEP 695)

* Use Any from typing to resolve mypy list unpacking bugs

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: John Law <johnlaw.po@gmail.com>
2026-05-18 23:14:42 +01:00
Ali AlimohammadiandJohn Law abf7168f57 feat: add Segment Intersection algorithm (#14416)
* feat: add Segment Intersection algorithm

* fix: use descriptive parameter names

---------

Co-authored-by: John Law <johnlaw.po@gmail.com>
2026-05-18 22:53:15 +01:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 791deb40f9 Bump actions/upload-pages-artifact from 4 to 5 (#14551)
Bumps [actions/upload-pages-artifact](https://github.com/actions/upload-pages-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-pages-artifact/releases)
- [Commits](https://github.com/actions/upload-pages-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-pages-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-14 00:00:57 +02:00
Mahemapre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Maxim Smolskiy
fc2f947e0f Fix empty input edge case and correct output formatting (#14444)
* Fix empty input edge case and correct output formatting

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update pigeonhole_sort.py

* Update pigeonhole_sort.py

* Update pigeonhole_sort.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
2026-04-11 01:07:38 +03:00
Aarav AryaandMaxim Smolskiy f944b9125d Add type hints to unknown_sort (#14489)
* Added type hints for bogo_sort

* Add type hints to unknown_sort

* Update bogo_sort.py

* Update unknown_sort.py

---------

Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
2026-04-11 00:07:41 +03:00
pre-commit-ci[bot]pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Maxim Smolskiy
02680c9055 [pre-commit.ci] pre-commit autoupdate (#14513)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.15.4 → v0.15.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.15.4...v0.15.9)
- [github.com/codespell-project/codespell: v2.4.1 → v2.4.2](https://github.com/codespell-project/codespell/compare/v2.4.1...v2.4.2)
- [github.com/tox-dev/pyproject-fmt: v2.16.2 → v2.21.0](https://github.com/tox-dev/pyproject-fmt/compare/v2.16.2...v2.21.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
2026-04-07 00:03:33 +03:00
MaxandMax 754dac42d9 fix: remove dead code in hamming_code.py to resolve SIM113 (#14509)
Co-authored-by: Max <183308611+max938-coder@users.noreply.github.com>
2026-04-06 23:55:59 +03:00
pre-commit-ci[bot]cclausspre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Maxim SmolskiyMaximSmolskiyChristian Clausscopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
840ca00ad3 [pre-commit.ci] pre-commit autoupdate (#14325)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.14.14 → v0.15.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.14.14...v0.15.4)
- [github.com/tox-dev/pyproject-fmt: v2.12.1 → v2.16.2](https://github.com/tox-dev/pyproject-fmt/compare/v2.12.1...v2.16.2)
- [github.com/abravalheri/validate-pyproject: v0.24.1 → v0.25](https://github.com/abravalheri/validate-pyproject/compare/v0.24.1...v0.25)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* updating DIRECTORY.md

* Configure mypy to target Python 3.14 and update to v1.20.0

Agent-Logs-Url: https://github.com/TheAlgorithms/Python/sessions/332481be-4c5f-4412-abf8-6ef4a3913828

Co-authored-by: cclauss <3709715+cclauss@users.noreply.github.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
Co-authored-by: MaximSmolskiy <MaximSmolskiy@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: cclauss <3709715+cclauss@users.noreply.github.com>
2026-04-02 02:50:30 +02:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 841e947e68 Bump actions/configure-pages from 5 to 6 (#14470)
Bumps [actions/configure-pages](https://github.com/actions/configure-pages) from 5 to 6.
- [Release notes](https://github.com/actions/configure-pages/releases)
- [Commits](https://github.com/actions/configure-pages/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/configure-pages
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-27 23:00:33 +01:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 257400487e Bump actions/deploy-pages from 4 to 5 (#14445)
Bumps [actions/deploy-pages](https://github.com/actions/deploy-pages) from 4 to 5.
- [Release notes](https://github.com/actions/deploy-pages/releases)
- [Commits](https://github.com/actions/deploy-pages/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/deploy-pages
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-25 22:51:17 +01:00
Jose NelsonPamela Canopre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Maxim Smolskiy
68473afc4b Add latitude and longitude validation to lamberts_ellipsoidal_distance (#14373)
* Add latitude and longitude validation with doctests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update lamberts_ellipsoidal_distance.py

---------

Co-authored-by: Pamela Cano <pamelacano@MacBook-Pro-de-Pamela.local>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
2026-03-14 00:53:47 +03:00
Mozart Maiapre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Maxim Smolskiy
7e4b60b05c add some doctests to algos in backtracking (#11911)
* add some doctests to algos in backtracking

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
2026-03-13 07:40:13 +03:00
MindaugasMaxim SmolskiyMaximSmolskiypre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
a2efba59bf Add euler project problem 15 additional solution (#12774)
* Add euler project problem 15 additional solution by explicitly counting the paths.

* Update sol2.py

* updating DIRECTORY.md

* updating DIRECTORY.md

* Trigger CI

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
Co-authored-by: MaximSmolskiy <MaximSmolskiy@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-03-13 00:00:28 +03:00
ThriveandMaxim Smolskiy c34f23e47e Add Extra edge cases (#12995)
* Add Extra edge cases

* Update coloring.py

---------

Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
2026-03-12 08:00:21 +03:00
Tejas RahaneandMaxim Smolskiy 135c748e55 Fix doctests in factorial_recursive function (#13703)
* Fix doctests in factorial_recursive function

The doctests in factorial_recursive were calling factorial() instead of factorial_recursive(). This fix ensures that the tests correctly validate the factorial_recursive function itself.

* Update factorial.py

---------

Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
2026-03-11 10:56:30 +03:00
Jaime Fernández González af131b7c3f Remove duplicated return statement in area_reg_polygon (#14362) 2026-03-10 08:44:09 +03:00
ADDALA MATHEWandMaxim Smolskiy 32a3d0d0bb Fix doctest bug in bubble_sort_recursive - incorrect function call (#13821)
Fixed bug in bubble_sort_recursive docstring where the doctest was calling bubble_sort_iterative([]) instead of bubble_sort_recursive([]). This was a copy-paste error that would cause the doctest to pass even if bubble_sort_recursive had issues with empty lists.

Change:
- Line 71: Changed '>>> bubble_sort_iterative([])' to '>>> bubble_sort_recursive([])'

This ensures the doctest properly validates the recursive implementation.

Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
2026-03-09 20:28:01 +03:00
Yaswanth Naga Sai KandMaxim Smolskiy 9ea690e098 Improve grammar in linear_search docstring (#14081)
* Improve grammar in linear_search docstring

Improved wording in the linear search docstring for better clarity. No code logic changed.

* Update linear_search.py

* Update linear_search.py

---------

Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
2026-03-09 09:05:13 +03:00
Yaswanth Naga Sai KandMaxim Smolskiy 7af5aba250 Improve sorted input validation in binary search (#14074)
* Improve sorted input validation in binary search

* Update binary_search.py

* Update binary_search.py

* Update binary_search.py

---------

Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
2026-03-09 08:55:03 +03:00
Parth PawarandMaxim Smolskiy 589d12972d Fix return type description in bubble_sort.py (#14137)
* Fix return type description in bubble_sort.py

Better (clearer, standard phrasing):
:return: the same collection ordered in ascending order

* Update bubble_sort.py

---------

Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
2026-03-09 08:33:34 +03:00
radhikaRM06andMaxim Smolskiy 6da02abdce Add doctests for duplicate and sorted inputs in bubble sort (#14154)
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
2026-03-09 08:22:38 +03:00
71c7fc8eed docs: upgrade mypy link to https (#14184)
Co-authored-by: JavedKhan93 <javed58725@gmail.com>
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
2026-03-09 08:09:38 +03:00
Yaadhuupre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Maxim Smolskiy
da6b9e9687 Use TypeError for non-string input in count_vowels (#14196)
* Use TypeError for non-string input in count_vowels

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix docstring and improve input validation in kth_lexicographic_permutation

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update kth_lexicographic_permutation.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
2026-03-09 07:57:20 +03:00
Shivang Aryapre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Maxim Smolskiy
1ae906a97b Fix incorrect doctest references in fibonacci functions (#14200)
* Fix incorrect doctest references in fibonacci functions

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
2026-03-09 07:49:15 +03:00
AnushaAnusha-DeviEpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Maxim Smolskiy
f5c3e7c808 Replace assert-based validation with explicit errors in modular_division (#14204)
* Improve documentation for linear search algorithm

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Replace asserts with explicit validation in modular_division

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update linear_search.py

---------

Co-authored-by: Anusha-DeviE <itzanushadevi@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
2026-03-09 07:37:31 +03:00
Tithi Joshipre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Maxim Smolskiy
049a34d62b Refine docstring and simplify reverse_letters implementation (#14205)
* docs: refine docstring and simplify reverse_letters implementation

Updated the docstring for clarity and improved the logic for reversing words.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update reverse_letters.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
2026-03-09 07:30:39 +03:00
KalyaniandMaxim Smolskiy 6f9f4318af all "is" replaced with "==" (#14209)
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
2026-03-09 07:15:03 +03:00
Yaadhuupre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Maxim Smolskiy
84b59c8781 Handle gcd(0, 0) edge case (#14215)
* Use TypeError for non-string input in count_vowels

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix docstring and improve input validation in kth_lexicographic_permutation

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Handle gcd(0, 0) edge case

* Update kth_lexicographic_permutation.py

* Update count_vowels.py

* Update greatest_common_divisor.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
2026-03-09 07:08:51 +03:00
Aarav AryaandMaxim Smolskiy 81fcb90f7b Add type hints for bogo_sort.py (#14306)
* Added type hints for bogo_sort

* Update bogo_sort.py

---------

Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
2026-03-09 06:32:52 +03:00
umutKaracelebipre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Maxim Smolskiy
0324e6098d style: add type hints to matrix_exponentiation.py (#14288)
* style: add type hints to matrix_exponentiation.py

* Refactor kth_permutation and fix linter errors

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Delete machine_learning/linear_discriminant_analysis.py

* Revert "Delete machine_learning/linear_discriminant_analysis.py"

This reverts commit de29647311.

* Update linear_discriminant_analysis.py

* Update kth_lexicographic_permutation.py

* Update matrix_exponentiation.py

* Update matrix_exponentiation.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
2026-03-09 06:18:15 +03:00
zain-cspre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Maxim Smolskiy
8e70e2e77b Add type hints and improve generate_parentheses_iterative (#14324)
* Add type hints and improve code quality for generate_parentheses_iterative

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix line length issue

* Update generate_parentheses_iterative.py

* Update generate_parentheses_iterative.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
2026-03-09 05:40:39 +03:00
Ali Alimohammadipre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>John LawChristian Clauss
f527d43d6d feat: add Graham Scan convex hull algorithm (#14251)
* feat: add Graham Scan convex hull algorithm

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix: address pre-commit issues

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* chore: Algorithm-Keeper's comments addressed

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: John Law <johnlaw.po@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2026-03-07 22:35:52 +00:00
John Law e333ddb852 chore: Fix ruff build failures (#14347) 2026-03-07 21:29:05 +01:00
Ali Alimohammadiandpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> ac05f1248c feat: add Jarvis March (Gift Wrapping) convex hull algorithm (#14225)
* Add Jarvis March (Gift Wrapping) convex hull algorithm

* Use descriptive parameter names per algorithms-keeper review

* Update jarvis_march.py

* Update jarvis_march.py

* fix: add pytest marker

* Update jarvis_march.py

* feat: removed doctests and created a separate test file for CI to pass

* Update jarvis_march_unit.py

* Update jarvis_march.py

* Update jarvis_march_unit.py

* feat: added test folder with tests to pass CI checks

* fix: duplicate points handled

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix: fixed ruff errors

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-03-07 19:47:34 +00:00
pre-commit-ci[bot]pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>pre-commit-ci[bot] <pre-commit-ci[bot]@users.noreply.github.com>
678dedbbf9 [pre-commit.ci] pre-commit autoupdate (#14238)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/MarcoGorelli/auto-walrus: 0.3.4 → 0.4.1](https://github.com/MarcoGorelli/auto-walrus/compare/0.3.4...0.4.1)
- [github.com/astral-sh/ruff-pre-commit: v0.14.10 → v0.14.14](https://github.com/astral-sh/ruff-pre-commit/compare/v0.14.10...v0.14.14)
- [github.com/tox-dev/pyproject-fmt: v2.11.1 → v2.12.1](https://github.com/tox-dev/pyproject-fmt/compare/v2.11.1...v2.12.1)

* updating DIRECTORY.md

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <pre-commit-ci[bot]@users.noreply.github.com>
2026-02-02 19:20:07 +01:00
Parth Pawar 8106aea67f Correct typo from 'two large' to 'too large' (#14135)
Fix typo in documentation regarding shift size.
2026-01-25 14:03:25 +00:00
Tithi Joshi 8fa4161587 docs: improve docstring clarity in reverse_words (#14212)
Updated function name and docstring for clarity.
2026-01-25 13:54:15 +00:00
Parag Sharmaandpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> ca5b8c156b Add sliding window maximum using monotonic deque (#14133)
* feat: add sliding window maximum using monotonic deque

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* feat: add sliding window maximum using monotonic deque

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-01-21 16:01:41 +00:00
pre-commit-ci[bot]pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>pre-commit-ci[bot] <pre-commit-ci[bot]@users.noreply.github.com>
3c887358e5 [pre-commit.ci] pre-commit autoupdate (#14078)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.14.7 → v0.14.10](https://github.com/astral-sh/ruff-pre-commit/compare/v0.14.7...v0.14.10)
- [github.com/pre-commit/mirrors-mypy: v1.19.0 → v1.19.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.19.0...v1.19.1)

* updating DIRECTORY.md

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <pre-commit-ci[bot]@users.noreply.github.com>
2026-01-05 22:57:27 +01:00
Ali AlimohammadiCopilotpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
68f876afef Add narcissistic number finder with dynamic programming (#13971)
* Add narcissistic number finder with dynamic programming

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update dynamic_programming/narcissistic_number.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update dynamic_programming/narcissistic_number.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update dynamic_programming/narcissistic_number.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-04 23:03:10 +00:00