Skip to content

Commit adc0210

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

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

matrix/pascal_triangle.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ def populate_current_row(triangle: List[List[int]], current_row_idx: int) -> Lis
9090
)
9191
return current_row
9292

93+
9394
def calculate_current_element(
9495
triangle: List[List[int]],
9596
current_row: List[int],
@@ -112,10 +113,10 @@ def generate_pascal_triangle_optimized(num_rows: int) -> List[List[int]]:
112113
"""
113114
Returns a matrix representing Pascal's triangle.
114115
Reduces operations by half by eliminating redundant calculations.
115-
116+
116117
:param num_rows: Number of rows in the Pascal's triangle
117118
:return: 2D list representing the Pascal's triangle
118-
119+
119120
>>> generate_pascal_triangle_optimized(3)
120121
[[1], [1, 1], [1, 2, 1]]
121122
>>> generate_pascal_triangle_optimized(1)
@@ -157,10 +158,12 @@ def generate_pascal_triangle_optimized(num_rows: int) -> List[List[int]]:
157158

158159
return result
159160

161+
160162
def benchmark() -> None:
161163
"""
162164
Benchmark functions with different input sizes
163165
"""
166+
164167
def benchmark_a_function(func: Callable, value: int) -> None:
165168
call = f"{func.__name__}({value})"
166169
timing = timeit(f"__main__.{call}", setup="import __main__")

0 commit comments

Comments
 (0)