C++ Two Stacks
cpp\nvector<int> v, m;\nvoid push(int x) {\n    v.push_back(x);\n    if (m.empty() || m.back() >= x)\n        m.push_back(x);\n}\nvoid pop() {\n    if (m.back()
```cpp\nvector<int> v, m;\nvoid push(int x) {\n    v.push_back(x);\n    if (m.empty() || m.back() >= x)\n        m.push_back(x);\n}\nvoid pop() {\n    if (m.back() == v.back())\n        m.pop_back();\n    v.pop_back();\n}\nint top() {\n    return v.back();\n}\nint getMin() {\n    return m.back();\n}\n```
[]