Problem minstack
User Niraideepa715
Submission Time 2024-12-11 15:10:45
Score 0
Max Time N/A
Max Memory N/A

Compile Error

minstack.cpp: In function ‘void push(int)’:
minstack.cpp:6:16: error: expected ‘;’ before ‘mn’
6 | v.push_back(x)
| ^
| ;
7 | mn.push_back(min(mn.back(),x));
| ~~
minstack.cpp: In function ‘void pop()’:
minstack.cpp:12:13: error: ‘x’ was not declared in this scope
12 | v.pop_back(x);
| ^
minstack.cpp:13:2: error: ‘mn’ was not declared in this scope; did you mean ‘yn’?
13 | mn.pop_back();
| ^~
| yn
minstack.cpp: In function ‘int top()’:
minstack.cpp:17:17: error: expected ‘;’ before ‘}’ token
17 | return v.back()
| ^
| ;
18 | }
| ~
minstack.cpp: In function ‘int getMin()’:
minstack.cpp:21:9: error: ‘mn’ was not declared in this scope; did you mean ‘yn’?
21 | return mn.back()
| ^~
| yn
minstack