Skip to content

Commit a010bd2

Browse files
authored
Update 907-sum-of-subarray-minimums.js
1 parent 6550b7e commit a010bd2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

907-sum-of-subarray-minimums.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const sumSubarrayMins = function(arr) {
1515

1616
for(let i = n - 1; i >= 0; i--) {
1717
let cnt = 1
18+
// use ">=" to deal with duplicate elements
1819
while(s2.length && s2[s2.length - 1][0] >= arr[i]) {
1920
cnt += s2.pop()[1]
2021
}

0 commit comments

Comments
 (0)