SPACE 100% BEATS || SHORT & SWEET C++ CODE
\nclass BrowserHistory {\npublic:\n    int curr=0;\n    int max_fwd=0;\n    unordered_map<int, string> umap;\n    \n    BrowserHistory(string homepage) {\n     
```\nclass BrowserHistory {\npublic:\n    int curr=0;\n    int max_fwd=0;\n    unordered_map<int, string> umap;\n    \n    BrowserHistory(string homepage) {\n        curr=0;\n        max_fwd=0;\n        umap[curr] = homepage;\n    }\n    \n    void visit(string url) {\n        curr++;\n        umap[curr]=url; \n        max_fwd=curr;\n    }\n    \n    string back(int steps) {\n        int goback = min(curr, steps);\n        curr-=goback;\n        return umap[curr];\n    }\n    \n    string forward(int steps) {\n        curr=min(max_fwd, curr+steps);\n        return umap[curr];\n    }\n};\n```
['C', 'C++']