Commit Graph

3441 Commits

Author SHA1 Message Date
jbsch
d0291190f9 Merge branch 'master' of https://github.com/ankana2113/Python 2024-10-24 22:27:54 +05:30
jbsch
5c2d1fe725 added largest rectangle histogram function 2024-10-24 22:06:42 +05:30
Ankana Pari
0c04372ebc
Merge pull request #1 from ankana2113/main
fixes ruff check in loss_functions.py
2024-10-24 16:44:54 +05:30
jbsch
1459adf8e4 fixed pre-commit issues 2024-10-24 16:41:25 +05:30
jbsch
1ff79750a8 Fix ruff check in loss_functions.py 2024-10-24 16:31:38 +05:30
jbsch
0ea341a18b descriptive names 2024-10-24 15:28:12 +05:30
jbsch
dcf47d4821 minor changes 2024-10-24 14:58:00 +05:30
jbsch
97eb853842 minor checks 2024-10-24 12:37:54 +05:30
jbsch
254b9bf87e minor checks 2024-10-24 12:18:13 +05:30
jbsch
f614b2efee minor chenges 2024-10-24 12:06:04 +05:30
jbsch
1918aac31e Merge branch 'main' of https://github.com/ankana2113/Python 2024-10-24 12:04:09 +05:30
jbsch
83d7252b3a ruff and minor checks 2024-10-24 12:03:41 +05:30
pre-commit-ci[bot]
59d3ceba27 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-10-24 05:24:49 +00:00
jbsch
d8c0b7c7b3 Merge branch 'main' of https://github.com/ankana2113/Python 2024-10-24 10:54:02 +05:30
jbsch
b0255a87fe added doctests 2024-10-24 10:51:59 +05:30
pre-commit-ci[bot]
d5963b2da7 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-10-23 15:34:23 +00:00
jbsch
544a38b016 resolved conflicts 2024-10-23 21:01:03 +05:30
pre-commit-ci[bot]
c76784e708 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-10-23 15:25:54 +00:00
jbsch
38764378d4 resolved conflicts 2024-10-23 20:55:20 +05:30
jbsch
1713cbe7c2 resolved errors 2024-10-23 20:51:58 +05:30
pre-commit-ci[bot]
2eeb450e2d [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-10-23 15:15:27 +00:00
jbsch
b1353dddd4 ridge regression 2024-10-23 20:44:04 +05:30
jbsch
7484cda516 ridge regression 2024-10-23 20:40:28 +05:30
pre-commit-ci[bot]
21fe32fcbe [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-10-23 14:21:41 +00:00
jbsch
6fc134d96c added ridge regression 2024-10-23 19:49:44 +05:30
jbsch
a84d209c08 added ridge regression 2024-10-23 19:47:34 +05:30
pre-commit-ci[bot]
d4fc2bf852 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-10-23 14:10:48 +00:00
jbsch
b72320b402 added ridge regression 2024-10-23 19:37:10 +05:30
jbsch
1cb79bc72a added ridge regression 2024-10-23 19:27:43 +05:30
pre-commit-ci[bot]
6e24935f88
[pre-commit.ci] pre-commit autoupdate (#12234)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.6.9 → v0.7.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.9...v0.7.0)
- [github.com/tox-dev/pyproject-fmt: 2.3.0 → 2.4.3](https://github.com/tox-dev/pyproject-fmt/compare/2.3.0...2.4.3)
- [github.com/abravalheri/validate-pyproject: v0.20.2 → v0.21](https://github.com/abravalheri/validate-pyproject/compare/v0.20.2...v0.21)
- [github.com/pre-commit/mirrors-mypy: v1.11.2 → v1.12.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.11.2...v1.12.1)

* project_euler/problem_047/sol1.py: def solution(n: int = 4) -> int | None:

* Update sol1.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>
2024-10-22 11:22:34 +02:00
pre-commit-ci[bot]
03a42510b0
[pre-commit.ci] pre-commit autoupdate (#12071)
updates:
- [github.com/tox-dev/pyproject-fmt: 2.2.4 → 2.3.0](https://github.com/tox-dev/pyproject-fmt/compare/2.2.4...2.3.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-10-14 22:42:24 +02:00
Christian Clauss
e9e7c96465
Create GitHub Pages docs with Sphinx (#11888) 2024-10-08 19:09:28 +02:00
Jeel Rupapara
260e3d8b35
feat: add test cases in cipher's autokey (#11881) 2024-10-08 13:33:28 +02:00
pre-commit-ci[bot]
2d671df073
[pre-commit.ci] pre-commit autoupdate (#11874)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.6.0...v5.0.0)
- [github.com/astral-sh/ruff-pre-commit: v0.6.8 → v0.6.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.8...v0.6.9)

* updating DIRECTORY.md

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <pre-commit-ci[bot]@users.noreply.github.com>
2024-10-07 22:49:29 +02:00
Lonercode
dba8eecb47
added gronsfeld cipher implementation (#11835)
* added gronsfeld cipher implementation

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

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

* from string import ascii_uppercase

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

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

* Update gronsfeld_cipher.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>
2024-10-07 11:58:07 +02:00
1227haran
cfd6d095f1
Added max_sum_bst.py (#11832)
* Added new algorithm

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

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

* Updated changes

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

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

* Updated filename

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

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

* Updated code

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

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

* Updated the code

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

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

* Updated code

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

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

* Updated the code

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

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

* Updated code

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

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

* Updated the code

* Updated code

* Updated code

* Updated code

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

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

* Updated the code

* Updated code

* Updated code

* Updated code

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

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

* Updated code

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

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

* Updated code

* updated

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

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

* Updated code

* Updated code

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

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

* Updated code

* Updated code

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

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

* Updated code

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

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

* Updated code

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

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

* Apply suggestions from code review

* Update maximum_sum_bst.py

* def max_sum_bst(root: TreeNode | None) -> int:

* def solver(node: TreeNode | None) -> tuple[bool, int, int, 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>
2024-10-07 10:36:15 +02:00
Jeel Rupapara
3422ebc75b
feat: add testcase of polynom_for_points (#11811)
* feat: add testcase of polynom_for_points

* fix: remove the print from the testcase of points_to_polynomial

* fix: remove print statement from old test cases
2024-10-07 08:30:11 +02:00
Vineet Kumar
fcf82a1eda
Implemented Exponential Search with binary search for improved perfor… (#11666)
* Implemented Exponential Search with binary search for improved performance on large sorted arrays.

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

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

* Added type hints and doctests for binary_search and exponential_search functions. Improved code documentation and ensured testability.

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

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

* Update and rename Exponential_Search.py to exponential_search.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>
2024-10-05 10:34:48 -07:00
Andrey Ivanov
ad6395d340
Update ruff usage example in CONTRIBUTING.md (#11772)
* Update ruff usage example

* Update CONTRIBUTING.md

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

---------

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2024-10-05 10:24:58 -07:00
Jeel Rupapara
50aca04c67
feat: increase test coverage of longest_common_subsequence to 75% (#11777) 2024-10-05 10:21:43 -07:00
1227haran
5a8655d306
Added new algorithm to generate numbers in lexicographical order (#11674)
* Added algorithm to generate numbers in lexicographical order

* Removed the test cases

* Updated camelcase to snakecase

* Added doctest

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

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

* Added descriptive name for n

* Reduced the number of letters

* Updated the return type

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

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

* Updated import statement

* Updated return type to Iterator[int]

* removed parentheses

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-10-05 10:19:58 -07:00
ARNAV RAJ
9a572dec2b
feat: Implemented Matrix Exponentiation Method (#11747)
* feat: add Matrix Exponentiation method
docs: updated the header documentation and added new documentation for
the new function.

* feat: added new function matrix exponetiation method

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

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

* feat: This function uses the tail-recursive form of the Euclidean algorithm to calculate

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

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

* reduced the number of characters per line in the comments

* removed unwanted code

* feat: Implemented a new function to swaap numbers without dummy variable

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

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

* removed previos code

* Done with the required changes

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

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

* Done with the required changes

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

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

* Done with the required changes

* Done with the required changes

* Done with the required changes

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

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

* Update maths/fibonacci.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

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

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

* Done with the required changes

* Done with the required changes

* Done with the required 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>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2024-10-04 09:29:39 -07:00
Lonercode
59ff87dc55
Added doctests to min_cost_string_conversion.py and removed :c specifier (#11721)
* Added doctests to min_cost_string_conversion.py and removed :c specifier

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

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

* resolved line length issues based on ruff requirements

* modified in compliance with ruff for line length

* Update strings/min_cost_string_conversion.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2024-10-04 02:36:14 -07:00
Sai Aswin Madhavan
917ad62105
Removed incorrect type hints (#11711) 2024-10-04 02:28:50 -07:00
Hardik Pawar
e20b503b24
Improve comments, add doctests for kahns_algorithm_topo.py (#11668)
* Improve comments, add doctests for kahns_algorithm_topo.py

* Improve function docstring

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

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

* Rename variables, remove print

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-10-04 02:06:08 -07:00
JeevaRamanathan
40f65e8150
Improve comments, docstrings in next_greatest_element.py (#11685)
* Improve comments in next_greatest_element.py

Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>

* few changes

Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>

* updated descriptions of the functions parameters

Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>

---------

Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>
2024-10-02 17:18:01 -07:00
Aswin P Kumar
080e7903a0
Add Word Break algorithm (#11687)
* Add Word Break algorithm

* Add Word Break algorithm

* [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-10-02 17:03:48 -07:00
Ali Rashid
f4b4ac159a
Adding Doctests to floyd_warshall.py (#11690)
* 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>
2024-10-02 16:54:56 -07:00
1227haran
918fa8bb8a
Optimized O(n) to O(1) (#11669) 2024-10-02 11:07:07 -07:00
Hardik Pawar
00e9d86224
Improve comments, add doctests in symmetric_tree.py (#11619) 2024-10-01 19:54:12 -07:00