Skip to content

Commit 616e284

Browse files
Merge branch 'TheAlgorithms:master' into master
2 parents b901cc0 + 787aa5d commit 616e284

File tree

6 files changed

+11
-7
lines changed

6 files changed

+11
-7
lines changed

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repos:
1616
- id: auto-walrus
1717

1818
- repo: https://github.com/astral-sh/ruff-pre-commit
19-
rev: v0.8.4
19+
rev: v0.8.6
2020
hooks:
2121
- id: ruff
2222
- id: ruff-format
@@ -47,7 +47,7 @@ repos:
4747
- id: validate-pyproject
4848

4949
- repo: https://github.com/pre-commit/mirrors-mypy
50-
rev: v1.14.0
50+
rev: v1.14.1
5151
hooks:
5252
- id: mypy
5353
args:

DIRECTORY.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
* [Baconian Cipher](ciphers/baconian_cipher.py)
8787
* [Base16](ciphers/base16.py)
8888
* [Base32](ciphers/base32.py)
89-
* [Base64](ciphers/base64.py)
89+
* [Base64 Cipher](ciphers/base64_cipher.py)
9090
* [Base85](ciphers/base85.py)
9191
* [Beaufort Cipher](ciphers/beaufort_cipher.py)
9292
* [Bifid](ciphers/bifid.py)
@@ -462,6 +462,7 @@
462462

463463
## Graphics
464464
* [Bezier Curve](graphics/bezier_curve.py)
465+
* [Digital Differential Analyzer Line](graphics/digital_differential_analyzer_line.py)
465466
* [Vector3 For 2D Rendering](graphics/vector3_for_2d_rendering.py)
466467

467468
## Graphs
@@ -663,6 +664,7 @@
663664
* [Gamma](maths/gamma.py)
664665
* [Gaussian](maths/gaussian.py)
665666
* [Gcd Of N Numbers](maths/gcd_of_n_numbers.py)
667+
* [Geometric Mean](maths/geometric_mean.py)
666668
* [Germain Primes](maths/germain_primes.py)
667669
* [Greatest Common Divisor](maths/greatest_common_divisor.py)
668670
* [Hardy Ramanujanalgo](maths/hardy_ramanujanalgo.py)
@@ -1329,7 +1331,7 @@
13291331
* [Title](strings/title.py)
13301332
* [Top K Frequent Words](strings/top_k_frequent_words.py)
13311333
* [Upper](strings/upper.py)
1332-
* [Wave](strings/wave.py)
1334+
* [Wave String](strings/wave_string.py)
13331335
* [Wildcard Pattern Matching](strings/wildcard_pattern_matching.py)
13341336
* [Word Occurrence](strings/word_occurrence.py)
13351337
* [Word Patterns](strings/word_patterns.py)
File renamed without changes.

dynamic_programming/longest_increasing_subsequence.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ def longest_subsequence(array: list[int]) -> list[int]: # This function is recu
2424
[10, 22, 33, 41, 60, 80]
2525
>>> longest_subsequence([4, 8, 7, 5, 1, 12, 2, 3, 9])
2626
[1, 2, 3, 9]
27+
>>> longest_subsequence([28, 26, 12, 23, 35, 39])
28+
[12, 23, 35, 39]
2729
>>> longest_subsequence([9, 8, 7, 6, 5, 7])
28-
[8]
30+
[5, 7]
2931
>>> longest_subsequence([1, 1, 1])
3032
[1, 1, 1]
3133
>>> longest_subsequence([])
@@ -44,7 +46,7 @@ def longest_subsequence(array: list[int]) -> list[int]: # This function is recu
4446
while not is_found and i < array_length:
4547
if array[i] < pivot:
4648
is_found = True
47-
temp_array = [element for element in array[i:] if element >= array[i]]
49+
temp_array = array[i:]
4850
temp_array = longest_subsequence(temp_array)
4951
if len(temp_array) > len(longest_subseq):
5052
longest_subseq = temp_array

project_euler/problem_002/sol4.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def solution(n: int = 4000000) -> int:
6161
if n <= 0:
6262
raise ValueError("Parameter n must be greater than or equal to one.")
6363
getcontext().prec = 100
64-
phi = (Decimal(5) ** Decimal(0.5) + 1) / Decimal(2)
64+
phi = (Decimal(5) ** Decimal("0.5") + 1) / Decimal(2)
6565

6666
index = (math.floor(math.log(n * (phi + 2), phi) - 1) // 3) * 3 + 2
6767
num = Decimal(round(phi ** Decimal(index + 1))) / (phi + 2)
File renamed without changes.

0 commit comments

Comments
 (0)