Commit Graph

12 Commits

Author SHA1 Message Date
Maxim Smolskiy
f437f92279
Enable ruff INP001 rule (#11346)
* Enable ruff INP001 rule

* Fix

* Fix

* Fix

* Fix

* Fix
2024-04-02 21:13:56 +02:00
pre-commit-ci[bot]
bc8df6de31
[pre-commit.ci] pre-commit autoupdate (#11322)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.2.2 → v0.3.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.2.2...v0.3.2)
- [github.com/pre-commit/mirrors-mypy: v1.8.0 → v1.9.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.8.0...v1.9.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>
2024-03-13 07:52:41 +01:00
Pedram_Mohajer
82e539dc82
Create smallestRange.py (#11179)
* Create smallestRange.py

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

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

* Update smallestRange.py

* Update smallestRange.py

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

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

* Update smallestRange.py

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

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

* Update and rename smallestRange.py to smallestrange.py

* Update smallestrange.py

* Update smallestrange.py

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

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

* Update smallestrange.py

* Rename smallestrange.py to smallest_range.py

* Update smallest_range.py

* Update smallest_range.py

* Update smallest_range.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>
2023-12-01 17:53:47 +01:00
Hardik Pawar
aeee0f42a5
Add doctests for fractional knapsack (#10891)
* Add doctests for fractional knapsack

* Update greedy_methods/fractional_knapsack.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Run doctests

* Update greedy_methods/fractional_knapsack.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update greedy_methods/fractional_knapsack.py

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2023-10-24 16:36:24 +02:00
Tianyi Zheng
73ebf7bdb1
Move and rename maths/greedy_coin_change.py (#10418)
* updating DIRECTORY.md

* updating DIRECTORY.md

* updating DIRECTORY.md

* updating DIRECTORY.md

* Move greedy_coin_change.py to greedy_methods/ and rename file

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-10-16 01:42:55 +02:00
Kosuri L Indu
982bc27358
add : Best time to buy and sell stock program under GREEDY methods (#10114)
* to add best_time_stock program

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

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

* Update best_time_to_buy_and_sell_stock.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>
2023-10-08 19:07:02 +02:00
Pronay Debnath
78af0c43c6
Create fractional_cover_problem.py (#9973)
* Create fractional_cover_problem.py

* Update fractional_cover_problem.py

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

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

* Update fractional_cover_problem.py

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

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

* Update fractional_cover_problem.py

* Update fractional_cover_problem.py

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

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

* Update fractional_cover_problem.py

* Update fractional_cover_problem.py

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

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

* Update fractional_cover_problem.py

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

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

* Lose __eq__()

* Update fractional_cover_problem.py

* Define Item property ratio

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2023-10-07 17:51:30 +02:00
Adebisi Ahmed
6643c95537
add gas station (#9446)
* feat: add gas station

* make code more readable

make code more readable

* update test

* Update gas_station.py

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

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

* tuple[GasStation, ...]

* [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>
2023-10-05 15:18:54 +02:00
Himanshu Tomar
e966c5cc0f
Added minimum waiting time problem solution using greedy algorithm (#8701)
* Added minimum waiting time problem solution using greedy algorithm

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

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

* ruff --fix

* Add type hints

* Added two more doc test

* Removed unnecessary comments

* updated type hints

* Updated the code as per the code review

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-05-01 12:23:03 +02:00
SudhanshuSuman
7f6e0b656f
Corrected the directory of Fractional Knapsack algorithm (#7086)
* Moved fractional knapsack from 'dynamic_programming' to 'greedy_methods'

* Updated DIRECTORY.md
2022-10-16 22:41:28 +02:00
Caeden
4d0c830d2c
Add flake8 pluin flake8 bugbear to pre-commit (#7132)
* ci(pre-commit): Add ``flake8-builtins`` additional dependency to ``pre-commit`` (#7104)

* refactor: Fix ``flake8-builtins`` (#7104)

* fix(lru_cache): Fix naming conventions in docstrings (#7104)

* ci(pre-commit): Order additional dependencies alphabetically (#7104)

* fix(lfu_cache): Correct function name in docstring (#7104)

* Update strings/snake_case_to_camel_pascal_case.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update data_structures/stacks/next_greater_element.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update digital_image_processing/index_calculation.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update graphs/prim.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update hashes/djb2.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* refactor: Rename `_builtin` to `builtin_` ( #7104)

* fix: Rename all instances (#7104)

* refactor: Update variable names (#7104)

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

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

* ci: Create ``tox.ini`` and ignore ``A003`` (#7123)

* revert: Remove function name changes (#7104)

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

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

* Rename tox.ini to .flake8

* Update data_structures/heap/heap.py

Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>

* refactor: Rename `next_` to `next_item` (#7104)

* ci(pre-commit): Add `flake8` plugin `flake8-bugbear` (#7127)

* refactor: Follow `flake8-bugbear` plugin (#7127)

* fix: Correct `knapsack` code (#7127)

* [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>
Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
2022-10-13 18:03:06 +02:00
Raj-Pansuriya
943e03fc54
Added Optimal Merge Pattern Algorithm (#5274)
* Minor changes due to precommit

* Update optimal_merge_pattern.py

Co-authored-by: Christian Clauss <cclauss@me.com>
2021-10-14 12:51:13 +02:00