Problem minstack
User aj
Submission Time 2025-01-27 10:14:44
Score 0
Max Time N/A
Max Memory N/A

Compile Error

minstack.cpp: In function ‘int getMin(std::stack<long long int>&)’:
minstack.cpp:6:24: error: no match for ‘operator[]’ (operand types are ‘std::stack<long long int>’ and ‘int’)
6 | long long min=minStack[0];
| ^
minstack.cpp:8:15: error: no match for ‘operator[]’ (operand types are ‘std::stack<long long int>’ and ‘long long int’)
8 | if (minStack[i]<min){
| ^
minstack.cpp:9:16: error: no match for ‘operator[]’ (operand types are ‘std::stack<long long int>’ and ‘long long int’)
9 | min=minStack[i];
| ^