Skip to content

Commit 7994fb6

Browse files
committed
Runtime: 3 ms (Top 65.19%) | Memory: 7.9 MB (Top 10.48%)
1 parent e6f856d commit 7994fb6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scripts/algorithms/B/Build an Array With Stack Operations/Build an Array With Stack Operations.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
// Runtime: 3 ms (Top 65.19%) | Memory: 7.9 MB (Top 10.48%)
12
class Solution {
23
public:
34
vector<string> buildArray(vector<int>& target, int n) {
4-
vector<string>ans;
5-
int l=target.size(), count=0,ind=0; // ind is index of the target array
6-
7-
5+
vector<string>ans;
6+
int l=target.size(), count=0,ind=0; // ind is index of the target array
7+
88
for(int i=1;i<=n;i++){
99
if(count==l) break;
1010
if(target[ind]!=i){
@@ -19,4 +19,4 @@ class Solution {
1919
}
2020
return ans;
2121
}
22-
};
22+
};

0 commit comments

Comments
 (0)