Skip to content

Commit 1c67f1f

Browse files
authored
Update 962.Maximum-Width-Ramp.cpp
1 parent 1ffe945 commit 1c67f1f

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

Stack/962.Maximum-Width-Ramp/962.Maximum-Width-Ramp.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,8 @@ class Solution {
77
int result = 0;
88

99
for (int i=0; i<nums.size();i++)
10-
{
11-
if (q.size()==0)
12-
{
13-
q.push_back(nums[i]);
14-
idx.push_back(i);
15-
continue;
16-
}
17-
18-
if (q.size()>0 && nums[i]<q.back())
10+
{
11+
if (q.size()==0 || q.size()>0 && nums[i]<q.back())
1912
{
2013
q.push_back(nums[i]);
2114
idx.push_back(i);

0 commit comments

Comments
 (0)