* added rotate_array.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fixed issues
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fixed reverse issue
* added doctests
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* changed k to steps for a descriptive name
* fixed non-pep
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* fix covid_stats_via_xpath.py
Improve error handling.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix covid_stats_via_xpath.py typo
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix ruff
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* upgrade covid_stats_via_xpath.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update and fix covid_stats_via_xpath.py
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* pre-commit autoupdate 2025-09-11
* [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>
* Adding the function isProthNumber(n : int) which returns true if n is a Proth number
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fixing the issues of the isprothnumber function
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* New fixes on isprothnumber()
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fixes on isprothnumber()
* Fixes on isprothnumber
* Fixes on isprothnumber()
* Fixes on isprothnumber
* Update proth_number.py
* Update proth_number.py
* Update proth_number.py
* Update proth_number.py
* Update proth_number.py
* Update proth_number.py
* Update proth_number.py
* Update proth_number.py
---------
Co-authored-by: Juanitoupipou <juan.dupierris@imt-atlantique.net>
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 space complexity
Space complexity of merge sort is a key factor, when compared to quick sort
* Update merge_sort.py
---------
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
* Add weierstrass_method for approximating complex roots
- Implements Durand-Kerner (Weierstrass) method for polynomial root finding
- Accepts user-defined polynomial function and degree
- Uses random perturbation of complex roots of unity for initial guesses
- Handles validation, overflow clipping, and includes doctest
* Update weierstrass_method.py
* add more tests
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update weierstrass_method.py
* Update weierstrass_method.py
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Fix enumeration order in FFT string representation
* updating DIRECTORY.md
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update radix2_fft.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: alejandroaldas <alejandroaldas@users.noreply.github.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>
* Fixes#12857 Use collections.deque as queue in graphs BFS shortest path 2
* Use collections.deque as queue in the correct syntax: queue = deque([start])
* Fix CI error due to HTTP 404 on https://finance.yahoo.com/quote/GOOG/\?p\=GOOG
* Undo change in workflows/build.yml as it's fixed in PR 12864
---------
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
* Fix `RuntimeError` in bipartite-check DFS/BFS and clean up doctests
* Iteration over `graph` mutated by `defaultdict` neighbours caused
`RuntimeError: dictionary changed size during iteration`.
– Iterate over `list(graph)` in both DFS and BFS helpers.
* Corrected `if __name__ == "__main__":` typo.
* Updated two doctests that now succeed after the fix.
All doctests now pass (`30/30`), eliminating a critical runtime failure and improving reliability of the graph algorithms.
Co-Authored-By: S. M. Mohiuddin Khan Shiam <147746955+mohiuddin-khan-shiam@users.noreply.github.com>
* Update check_bipatrite.py
* Update check_bipatrite.py
* Update check_bipatrite.py
* Update check_bipatrite.py
* Update check_bipatrite.py
* Update check_bipatrite.py
* Update check_bipatrite.py
* Update check_bipatrite.py
* Update check_bipatrite.py
---------
Co-authored-by: Odio Marcelino <odiomarcelino@gmail.com>
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
* Update comments for linked list script.
* Add doctests for the linked list script.
* Update from_sequence.py
---------
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
* fix(strings): use frequency-based signature for anagrams
Replaced the sorting-based signature implementation with a frequency-based
approach using `collections.Counter`. This ensures that the signature
represents both characters and their counts, preventing collisions and
better grouping of true anagrams.
Examples:
- "test" → "e1s1t2"
- "finaltest" → "a1e1f1i1l1n1s1t2"
- "this is a test" → " 3a1e1h1i2s3t3"
Also updated the anagram lookup to use the new frequency-based signatures, making results more accurate and avoiding false positives.
* Refactor anagram function return type to list[str]
* Update anagrams.py
* Update anagrams.py
* Update anagrams.py
* Update anagrams.py
* [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: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* feat: Add recursive implication function for lists
* Update imply_gate.py
* Update imply_gate.py
* [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: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Simplify the capitalize function using ASCII arithmetic to make the algorithm five times faster.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update capitalize.py
* Update capitalize.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>