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

Compile Error

minstack.cpp:3:1: error: ‘stack’ does not name a type
3 | stack<int> mainStack;
| ^~~~~
minstack.cpp:4:1: error: ‘stack’ does not name a type
4 | stack<int> minStack;
| ^~~~~
minstack.cpp: In function ‘void push(int)’:
minstack.cpp:7:5: error: ‘mainStack’ was not declared in this scope
7 | mainStack.push(X);
| ^~~~~~~~~
minstack.cpp:8:9: error: ‘minStack’ was not declared in this scope
8 | if (minStack.empty() || X <= minStack.top()) {
| ^~~~~~~~
minstack.cpp: In function ‘void pop()’:
minstack.cpp:14:9: error: ‘mainStack’ was not declared in this scope
14 | if (mainStack.empty()) return;
| ^~~~~~~~~
minstack.cpp:15:9: error: ‘mainStack’ was not declared in this scope
15 | if (mainStack.top() == minStack.top()) {
| ^~~~~~~~~
minstack.cpp:15:28: error: ‘minStack’ was not declared in this scope
15 | if (