Problem minstack
User asruby
Submission Time 2025-01-04 23:05:42
Score 0
Max Time N/A
Max Memory N/A

Compile Error

minstack.cpp: In function ‘void push(int)’:
minstack.cpp:10:12: error: request for member ‘push’ in ‘minstack’, which is of non-class type ‘int’
10 | minstack.push(X);
| ^~~~
minstack.cpp:14:20: error: request for member ‘top’ in ‘minstack’, which is of non-class type ‘int’
14 | if (X < minstack.top()){
| ^~~
minstack.cpp:15:13: error: request for member ‘push’ in ‘minstack’, which is of non-class type ‘int’
15 | minstack.push(X);
| ^~~~
minstack.cpp:19:12: error: a function-definition is not allowed here before ‘{’ token
19 | void pop() {
| ^
minstack.cpp:28:11: error: a function-definition is not allowed here before ‘{’ token
28 | int top() {
| ^
minstack.cpp:32:14: error: a function-definition is not allowed here before ‘{’ token
32 | int getMin() {
| ^
minstack.cpp:34:1: error: expected ‘