Skip to content

Commit 6be290c

Browse files
authored
Update sparse_table.py
1 parent fdba816 commit 6be290c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: data_structures/arrays/sparse_table.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"""
1313

1414

15-
def build_sparse_table(arr: list[int], arr_length: int) -> list[int]:
15+
def build_sparse_table(arr: list[int], arr_length: int) -> list[list[int]]:
1616
"""
1717
Precompute range minimum queries with power of two length
1818
and store the precomputed values in a table.
@@ -52,7 +52,7 @@ def build_sparse_table(arr: list[int], arr_length: int) -> list[int]:
5252
return lookup
5353

5454

55-
def query(lookup: list[int], left_bound: int, right_bound: int) -> int:
55+
def query(lookup: list[list[int]], left_bound: int, right_bound: int) -> int:
5656
"""
5757
>>> query(build_sparse_table([8, 1, 0, 3, 4, 9, 3], 7), 0, 4)
5858
0

0 commit comments

Comments
 (0)