C++ || EASY TO UNDERSTAND || simple code
\nclass BrowserHistory {\nprivate:\n    vector<string> v;\n    int i;\npublic:\n    BrowserHistory(string homepage) {\n        v.push_back(homepage);\n        i
```\nclass BrowserHistory {\nprivate:\n    vector<string> v;\n    int i;\npublic:\n    BrowserHistory(string homepage) {\n        v.push_back(homepage);\n        i=0;\n    }\n    \n    void visit(string url) {\n        v.erase(v.begin()+i+1,v.end());\n        v.push_back(url);\n        i++;\n    }\n    \n    string back(int steps) {\n        i=max(0,i-steps);\n        return v[i];\n    }\n    \n    string forward(int steps) {\n        i=min((int)(v.size()-1),(int)(i+steps));\n        return v[i];\n    }\n};\n```\n**Please upvote to motivate me in my quest of documenting all leetcode solutions(to help the community). HAPPY CODING:)\nAny suggestions and improvements are always welcome**
[]