Skip to content

Commit ec31f5d

Browse files
authored
Update maximum-of-minimum-values-in-all-subarrays.py
1 parent 91adf67 commit ec31f5d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/maximum-of-minimum-values-in-all-subarrays.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def find_bound(nums, direction, init):
1111
result = [0]*len(nums)
1212
stk = [init]
1313
for i in direction(xrange(len(nums))):
14-
while stk[-1] not in (-1, len(nums)) and nums[stk[-1]] >= nums[i]:
14+
while stk[-1] != init and nums[stk[-1]] >= nums[i]:
1515
stk.pop()
1616
result[i] = stk[-1]
1717
stk.append(i)

0 commit comments

Comments
 (0)