5 Commits

Author SHA1 Message Date
pre-commit-ci[bot]
8112c055eb [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-02-16 09:34:11 +00:00
Cfengsu2002
ec2723f296
Update minimum_coin_change.py
Change with format
2025-02-16 04:33:47 -05:00
pre-commit-ci[bot]
72868008ad [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-02-16 09:00:33 +00:00
Cfengsu2002
ff961fa04a Update minimum_coin_change.py
Fix: Improve minimum coin change logic & add doctest

- Removed unnecessary int() conversions to improve efficiency.
- Updated function parameter type (value: str → value: int) to avoid redundant type casting.
- Added try-except handling to prevent ValueError when user input is not a number.
- Implemented testmod() to enable automated doctest verification.
- Fixed issue where input denominations were not sorted in descending order, which previously led to incorrect results.
2025-02-16 03:57:21 -05: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