Skip to content

Commit 750956a

Browse files
committed
Runtime: 324 ms (Top 61.68%) | Memory: 88.2 MB (Top 5.31%)
1 parent 2246447 commit 750956a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/algorithms/O/Online Stock Span/Online Stock Span.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
// Runtime: 324 ms (Top 61.68%) | Memory: 88.2 MB (Top 5.31%)
12
class StockSpanner {
23
public:
34
stack<pair<int , int>>s; //val , index
45
vector<int>prices;
56
vector<int>res;
67
StockSpanner() {
7-
8+
89
}
9-
10+
1011
int next(int price) {
1112
prices.push_back(price);
1213
int n = prices.size();
@@ -30,4 +31,4 @@ class StockSpanner {
3031
}
3132
return res[n-1];
3233
}
33-
};
34+
};

0 commit comments

Comments
 (0)