* Ruff test resolution
* [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>
* Enable ruff E741 rule
* [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>
* Changing the code to return tuple
* Changing the code to return tuple
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update dynamic_programming/subset_generation.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Adding doctests in subset_generation.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update subset_generation.py
* Update subset_generation.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update subset_generation.py
* Update subset_generation.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update dynamic_programming/subset_generation.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update stock_span_problem.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update subset_generation.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update subset_generation.py
* Update subset_generation.py
* Update subset_generation.py
* Update subset_generation.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>
* To add wildcard_matching.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* changes for doctest errors
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* code changes
* [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>
* added doctests
* added doctests
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add doctests to integer_partition.py
* Update minimum_partition.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>
* Update minimum_steps_to_one.py
Made the problem explanation more clear and readable
* updating DIRECTORY.md
* Apply suggestions from code review
---------
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
* Add doctests, type hints; fix bug
* [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>
* to add the trapped water program
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* to make changes for error : B006
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* to make changes for error : B006
* to make changes for error : B006
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* to make changes in doctest
* to make changes in doctest
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update dynamic_programming/trapped_water.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update dynamic_programming/trapped_water.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* to make changes in parameters
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* to make changes in parameters
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update dynamic_programming/trapped_water.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* to make changes in parameters
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* for negative heights
* Update dynamic_programming/trapped_water.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* to remove falsy
* Final edits
* tuple[int, ...]
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* largest divisible subset
* minor tweaks
* adding more test cases
Co-authored-by: Christian Clauss <cclauss@me.com>
* improving code for better readability
Co-authored-by: Christian Clauss <cclauss@me.com>
* update
Co-authored-by: Christian Clauss <cclauss@me.com>
* update
Co-authored-by: Christian Clauss <cclauss@me.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* suggested changes done, and further modfications
* final update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update largest_divisible_subset.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update largest_divisible_subset.py
---------
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* DRAFT: GitHub Actions: Test on Python 3.12
Repeats #8777
* #8777
Some of our dependencies will not be ready yet.
* Python 3.12: Disable qiskit and tensorflow algorithms
* updating DIRECTORY.md
---------
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* added smith waterman algorithm
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* descriptive names for the parameters a and b
* doctesting lowercase upcase empty string cases
* updated block quot,fixed traceback and doctests
* shorter block quote
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
* global vars to func params,more doctests
* updated doctests
* user access to SW params
* formating
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
* added a problem with solution on sliding window.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* added hint for return type and parameter
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update minimum_size_subarray_sum.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update minimum_size_subarray_sum.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update minimum_size_subarray_sum.py
* Update minimum_size_subarray_sum.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update minimum_size_subarray_sum.py
* removed un-necessary docs and added 2 test cases
* Rename sliding_window/minimum_size_subarray_sum.py to dynamic_programming/minimum_size_subarray_sum.py
* Update minimum_size_subarray_sum.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update minimum_size_subarray_sum.py
* Update minimum_size_subarray_sum.py
* Update minimum_size_subarray_sum.py
* Update minimum_size_subarray_sum.py
* Update minimum_size_subarray_sum.py
* Update minimum_size_subarray_sum.py
* Update dynamic_programming/minimum_size_subarray_sum.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update dynamic_programming/minimum_size_subarray_sum.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update dynamic_programming/minimum_size_subarray_sum.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update dynamic_programming/minimum_size_subarray_sum.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update dynamic_programming/minimum_size_subarray_sum.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update dynamic_programming/minimum_size_subarray_sum.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update dynamic_programming/minimum_size_subarray_sum.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update minimum_size_subarray_sum.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update minimum_size_subarray_sum.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update minimum_size_subarray_sum.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update minimum_size_subarray_sum.py
* Update minimum_size_subarray_sum.py
* [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>
* Remove python_version < "3.11" for tensorflow
* Reenable neural_network/input_data.py_tf
* updating DIRECTORY.md
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Try to fix ruff
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Try to fix ruff
* Try to fix ruff
* Try to fix ruff
* Try to fix pre-commit
* Try to fix
* Fix
* Fix
* Reenable dynamic_programming/k_means_clustering_tensorflow.py_tf
* updating DIRECTORY.md
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Try to fix ruff
---------
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* added kadane's algorithm directory with one problem's solution.
* added type hints
* Rename kaadne_algorithm/max_product_subarray.py to dynamic_programming/max_product_subarray.py
* Update dynamic_programming/max_product_subarray.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update max_product_subarray.py
* Update max_product_subarray.py
* Update dynamic_programming/max_product_subarray.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update max_product_subarray.py
* Update max_product_subarray.py
* Update max_product_subarray.py
* Update max_product_subarray.py
* Update max_product_subarray.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update max_product_subarray.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update max_product_subarray.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update max_product_subarray.py
* Update max_product_subarray.py
* Update dynamic_programming/max_product_subarray.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update dynamic_programming/max_product_subarray.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update max_product_subarray.py
---------
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* pre-commit: Upgrade psf/black for stable style 2023
Updating https://github.com/psf/black ... updating 22.12.0 -> 23.1.0 for their `2023 stable style`.
* https://github.com/psf/black/blob/main/CHANGES.md#2310
> This is the first [psf/black] release of 2023, and following our stability policy, it comes with a number of improvements to our stable style…
Also, add https://github.com/tox-dev/pyproject-fmt and https://github.com/abravalheri/validate-pyproject to pre-commit.
I only modified `.pre-commit-config.yaml` and all other files were modified by pre-commit.ci and psf/black.
* [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>
* refactor: Condense `password` related files in one
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update other/password.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* dynamic_programming
* test: Make test input `str`
* requirements.txt: Remove cython>=0.29.28 # For statsmodels on Python 3.11
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* add dp up - down minimum cost for tickets
* add typints
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* add new tests and checks.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* add more tests
* add types for the dp function
* Update dynamic_programming/minimum_tickets_cost.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* fix review notes
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* small fix
* Update dynamic_programming/minimum_tickets_cost.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update dynamic_programming/minimum_tickets_cost.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix tests
* Update dynamic_programming/minimum_tickets_cost.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update dynamic_programming/minimum_tickets_cost.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>
* Refactor bottom-up function to be class method
* Add type hints
* Update convolve function namespace
* Remove depreciated np.float
* updating DIRECTORY.md
* updating DIRECTORY.md
* updating DIRECTORY.md
* updating DIRECTORY.md
* Renamed function for consistency
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Chris O <46587501+ChrisO345@users.noreply.github.com>
* Added code for palindrome partitioning problem under dynamic programming
* Updated return type for function
* Updated Line 24 according to suggestions
* Apply suggestions from code review
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
* Update palindrome_partitioning.py
* Update palindrome_partitioning.py
* is_palindromic
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
* add Levinstein distance with Dynamic Programming: up -> down approach
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* add type hint
* fix flake8
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update dynamic_programming/min_distance_up_bottom.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update min_distance_up_bottom.py
* [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>
* Added Viterbi algorithm Fixes: #7465
Squashed commits
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Added doctest for validators
* moved all extracted functions to the main function
* Forgot a type hint
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Create combination_sum_iv.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update dynamic_programming/combination_sum_iv.py
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
* Update dynamic_programming/combination_sum_iv.py
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
* Update dynamic_programming/combination_sum_iv.py
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update combination_sum_iv.py
* Update combination_sum_iv.py
* Resolved PR Comments
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* minor change, argument missing in function
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update dynamic_programming/combination_sum_iv.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* minor change
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Adopt Python >= 3.8 assignment expressions using auto-walrus
* updating DIRECTORY.md
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>