Skip to content

Python #1

Open
NazeerIn wants to merge 3516 commits into
123gpg321:masterfrom
TheAlgorithms:master
Open

Python #1
NazeerIn wants to merge 3516 commits into
123gpg321:masterfrom
TheAlgorithms:master

Conversation

@NazeerIn

Copy link
Copy Markdown

Hello

pre-commit-ci Bot and others added 30 commits November 11, 2024 21:05
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.7.2 → v0.7.3](astral-sh/ruff-pre-commit@v0.7.2...v0.7.3)
- [github.com/abravalheri/validate-pyproject: v0.22 → v0.23](abravalheri/validate-pyproject@v0.22...v0.23)

* Update sudoku_solver.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.7.3 → v0.7.4](astral-sh/ruff-pre-commit@v0.7.3...v0.7.4)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.4.10 → v0.5.0](astral-sh/ruff-pre-commit@v0.4.10...v0.5.0)
- [github.com/pre-commit/mirrors-mypy: v1.10.0 → v1.10.1](pre-commit/mirrors-mypy@v1.10.0...v1.10.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Added matrix based color game

* updating DIRECTORY.md

---------

Co-authored-by: Miranda13 <Miranda13@users.noreply.github.com>
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.8.0 → v0.8.1](astral-sh/ruff-pre-commit@v0.8.0...v0.8.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Use Astral uv

* uvx vs uv run

* uv sync --group=euler-validate,test

* uv sync --group=euler-validate --group=test

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

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

* --group=test

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.8.1 → v0.8.2](astral-sh/ruff-pre-commit@v0.8.1...v0.8.2)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.8.2 → v0.8.3](astral-sh/ruff-pre-commit@v0.8.2...v0.8.3)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* updating DIRECTORY.md

* Fix sphinx/build_docs warnings for audio_filters

* Improve

* Fix

* Fix

* Fix

---------

Co-authored-by: MaximSmolskiy <MaximSmolskiy@users.noreply.github.com>
* updating DIRECTORY.md

* Fix sphinx/build_docs warnings for cellular_automata

* Fix

* Improve

---------

Co-authored-by: MaximSmolskiy <MaximSmolskiy@users.noreply.github.com>
* updating DIRECTORY.md

* Fix sphinx/build_docs warnings for geodesy/haversine_distance.py

* Improve

---------

Co-authored-by: MaximSmolskiy <MaximSmolskiy@users.noreply.github.com>
* updating DIRECTORY.md

* Fix sphinx/build_docs warnings for greedy_methods

* Improve

---------

Co-authored-by: MaximSmolskiy <MaximSmolskiy@users.noreply.github.com>
* Fix sphinx/build_docs warnings for maths/volume

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix
* Fix sphinx/build_docs warnings for graphs/check_bipatrite

* Fix
Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 4 to 5.
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](astral-sh/setup-uv@v4...v5)

---
updated-dependencies:
- dependency-name: astral-sh/setup-uv
  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>
* Improve coverage bell_numbers

* improve more function

* Update hamming_numbers.py

---------

Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
* #9943 : Adding coverage test for basic_graphs.py

* #9943 : Adding coverage test for basic_graphs.py

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

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

* Solve problem of line too long

* Improving coverage for matrix_exponentiation.py

* fix more than one file

* 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>
* test electric_power

* Update electric_power.py

* Update electric_power.py

* Update electric_power.py

* Update electric_power.py

---------

Co-authored-by: Julia <julia.de-jesus-aragao@imt-atlantique.net>
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
* updating DIRECTORY.md

* Fix Gaussian elimination pivoting

* Fix review issues

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

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

---------

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>
…ber.py (#12477)

* Add additional doctests for the perfect number algorithm and fix grammatical errors. Contributes to #9943

* Added newline at End of file

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

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

* Apply suggestions from code review

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
* adding doctests to trapezoidal_rule.py

* adding algorithm delta-star transformation

* updating DIRECTORY.md

* delete file star_delta_transform.py

* updating DIRECTORY.md

* modified:   ../DIRECTORY.md

---------

Co-authored-by: MRJPEREZR <MRJPEREZR@users.noreply.github.com>
* compare-method added to Vector class in lib.py

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

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

* Updated lib.py with suggestions

* Updated lib.py with suggestions

* Updated lib.py with __eq__ method

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Fix split function to handle trailing delimiters correctly

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

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

* Update split.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>
* fixed the issue in strings/join.py

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

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

* Update join.py

* Update join.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>
Shivanggaryaa and others added 30 commits March 9, 2026 07:49
* 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>
* 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>
Co-authored-by: JavedKhan93 <javed58725@gmail.com>
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
* 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>
* 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>
* 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>
…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>
* 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>
* Add Extra edge cases

* Update coloring.py

---------

Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
* 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>
* 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>
#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>
Bumps [actions/deploy-pages](https://github.com/actions/deploy-pages) from 4 to 5.
- [Release notes](https://github.com/actions/deploy-pages/releases)
- [Commits](actions/deploy-pages@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>
Bumps [actions/configure-pages](https://github.com/actions/configure-pages) from 5 to 6.
- [Release notes](https://github.com/actions/configure-pages/releases)
- [Commits](actions/configure-pages@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>
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.14.14 → v0.15.4](astral-sh/ruff-pre-commit@v0.14.14...v0.15.4)
- [github.com/tox-dev/pyproject-fmt: v2.12.1 → v2.16.2](tox-dev/pyproject-fmt@v2.12.1...v2.16.2)
- [github.com/abravalheri/validate-pyproject: v0.24.1 → v0.25](abravalheri/validate-pyproject@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>
Co-authored-by: Max <183308611+max938-coder@users.noreply.github.com>
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.15.4 → v0.15.9](astral-sh/ruff-pre-commit@v0.15.4...v0.15.9)
- [github.com/codespell-project/codespell: v2.4.1 → v2.4.2](codespell-project/codespell@v2.4.1...v2.4.2)
- [github.com/tox-dev/pyproject-fmt: v2.16.2 → v2.21.0](tox-dev/pyproject-fmt@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>
* 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>
* 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>
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](actions/upload-pages-artifact@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>
* feat: add Segment Intersection algorithm

* fix: use descriptive parameter names

---------

Co-authored-by: John Law <johnlaw.po@gmail.com>
* 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>
…4372)

* 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>
* 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>
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.15.9 → v0.15.12](astral-sh/ruff-pre-commit@v0.15.9...v0.15.12)
- [github.com/tox-dev/pyproject-fmt: v2.21.0 → v2.21.1](tox-dev/pyproject-fmt@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>
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.15.14 → v0.15.15](astral-sh/ruff-pre-commit@v0.15.14...v0.15.15)
- [github.com/tox-dev/pyproject-fmt: v2.21.2 → v2.23.0](tox-dev/pyproject-fmt@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>
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](actions/checkout@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>
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.15.15 → v0.15.20](astral-sh/ruff-pre-commit@v0.15.15...v0.15.20)
- [github.com/tox-dev/pyproject-fmt: v2.23.0 → v2.25.1](tox-dev/pyproject-fmt@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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.