c++|stack
class BrowserHistory {\npublic:\n    stacka;\n    stackb;\n    BrowserHistory(string homepage) {\n        a.push(homepage);\n    }\n    \n    void visit(string 
class BrowserHistory {\npublic:\n    stack<string>a;\n    stack<string>b;\n    BrowserHistory(string homepage) {\n        a.push(homepage);\n    }\n    \n    void visit(string url) {\n        a.push(url);\n        while(!b.empty()){\n            b.pop();\n        }\n    }\n    \n    string back(int steps) {\n        while(a.size()>1 && steps!=0){\n            b.push(a.top());\n            a.pop();\n            steps--;\n        }\n        return a.top();\n    }\n    \n    string forward(int steps) {\n        while(b.size()>0 && steps!=0){\n            a.push(b.top());\n            b.pop();\n            steps--;\n        }\n        return a.top();\n\n    }\n};\n
['Stack', 'C']