Skip to content

Commit 344a545

Browse files
pa-kh039cclauss
andauthored
update
Co-authored-by: Christian Clauss <[email protected]>
1 parent 16ff978 commit 344a545

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

dynamic_programming/largest_divisible_subset.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ def largest_divisible_subset(array: list[int]) -> list[int]:
4848
last_index = -1
4949

5050
# Find the maximum length and its corresponding index
51-
for i in range(array_size):
52-
if memo[i] > ans:
53-
ans = memo[i]
51+
for i, memo_item in enumerate(memo):
52+
if memo_item > ans:
53+
ans = memo_item
5454
last_index = i
5555

5656
# Reconstruct the divisible subset

0 commit comments

Comments
 (0)