Skip to content

Commit c836c89

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 658a1fe commit c836c89

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

maths/find_max.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
from __future__ import annotations
2+
3+
24
def find_max_iterative(nums: list[int | float]) -> int | float:
35
"""
46
>>> for nums in ([3, 2, 1], [-3, -2, -1], [3, -3, 0], [3.0, 3.1, 2.9]):
@@ -22,11 +24,11 @@ def find_max_iterative(nums: list[int | float]) -> int | float:
2224
max_num = x
2325
return max_num
2426

25-
27+
2628
# Divide and Conquer algorithm
2729
# Using Divide and Conquer approach:
2830
# 1. Divide the array into two halves
29-
# 2. Recursively find the maximum in each half
31+
# 2. Recursively find the maximum in each half
3032
# 3. Combine the results by comparing the two maximums
3133
def find_max_recursive(nums: list[int | float], left: int, right: int) -> int | float:
3234
"""

0 commit comments

Comments
 (0)