C++ | Vector Implementation | Easy | ~99% Space ~74% Time
\nclass BrowserHistory {\npublic:\n    int curr, r;\n    vector<string> ds;\n    BrowserHistory(string homepage) {\n      ds.resize(1);\n      ds[0] = homepage;
```\nclass BrowserHistory {\npublic:\n    int curr, r;\n    vector<string> ds;\n    BrowserHistory(string homepage) {\n      ds.resize(1);\n      ds[0] = homepage;\n      curr = 0; r = ds.size();\n    }\n    \n    void visit(string url) {\n      curr++;\n      if(curr == ds.size()){\n        ds.emplace_back(url);\n        r = ds.size();\n      } \n      else {\n        r = curr + 1;\n        // ds.resize(curr);\n        // ds.emplace_back(url);\n        ds[curr] = url;\n      }\n    }\n    \n    string back(int steps) {\n      curr = max(0, curr - steps);\n      return ds[curr];\n    }\n    \n    string forward(int steps) {\n      curr = min(r - 1, curr + steps);\n      return ds[curr];\n    }\n};\n```
['Array', 'C', 'C++']