Easiest C++ Code Design  (Vector)
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:O(n)\n- Each method takes O(1)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass BrowserHistory {\npublic:\nvector<string>a;\nint ind=-1;\nint end=0;\n    BrowserHistory(string homepage) {\n        a.push_back(homepage);\n        ind=0;\n        \n    }\n    \n    void visit(string url) {\n        if(ind<a.size()-1){\n            a[++ind]=url;\n            end=ind;\n        }\n        else{\n        a.push_back(url);\n        ind=a.size()-1;\n        end=ind;}\n        \n    }\n    \n    string back(int steps) {\n        ind-=steps;\n        \n        if(ind<0)\n        ind=0;\n\n        return a[ind];\n    }\n    \n    string forward(int steps) {\n        ind+=steps;\n        \n        if(ind>end)\n        ind=end;\n        return a[ind];\n\n    }\n};\n\n/**\n * Your BrowserHistory object will be instantiated and called as such:\n * BrowserHistory* obj = new BrowserHistory(homepage);\n * obj->visit(url);\n * string param_2 = obj->back(steps);\n * string param_3 = obj->forward(steps);\n */\n```
['Array', 'Design', 'C++']