Skip to content

Commit a0dcdf4

Browse files
committed
Runtime: 1574 ms (Top 5.27%) | Memory: 22.4 MB (Top 17.30%)
1 parent 8a3aed0 commit a0dcdf4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/algorithms/N/Number of Subarrays with Bounded Maximum/Number of Subarrays with Bounded Maximum.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Runtime: 1574 ms (Top 5.27%) | Memory: 22.4 MB (Top 17.30%)
12
class Solution:
23
def numSubarrayBoundedMax(self, nums: List[int], left: int, right: int) -> int:
34
n = len(nums)
@@ -17,4 +18,4 @@ def numSubarrayBoundedMax(self, nums: List[int], left: int, right: int) -> int:
1718
l = prev_greater[i]
1819
r = next_greater[i]
1920
res += (i - l) * (r - i)
20-
return res
21+
return res

0 commit comments

Comments
 (0)